detail.vue 27 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259
  1. <template>
  2. <mobile-frame>
  3. <view class="main">
  4. <view class="one">
  5. <scroll-view scroll-y="true" class="scroll-view">
  6. <view class="list-scroll-view">
  7. <view class="one_1">
  8. <swiper class="swiper" circular :indicator-dots="true" indicator-color="#ffffff"
  9. indicator-active-color="#FB1438" :interval="3000" :duration="1000">
  10. <swiper-item class="list" v-for="(item,index) in info.goods.file" :key="index">
  11. <image class="image" :src="item.url" mode="aspectFit">
  12. </image>
  13. </swiper-item>
  14. </swiper>
  15. <!-- 是否关注商品 -->
  16. <view class="goodsColect">
  17. <text @tap="toGoodscolect"
  18. :class="['iconfont',goodsColect?'icon-yduishoucangshixin-copy':'icon-yduishoucangkongxin']"></text>
  19. </view>
  20. </view>
  21. <view class="one_2">
  22. <text
  23. class="money"><text>¥</text>{{info.specs&&info.specs.length>0?info.specs[0].sell_money:0}}</text>
  24. <text
  25. class="money"><text>¥</text>{{info.specs&&info.specs.length>0?info.specs[0].flow_money:0}}</text>
  26. </view>
  27. <view class="one_3">
  28. <view class="name">
  29. {{info.goods.name}}
  30. </view>
  31. <view class="brief">
  32. {{info.goods.shot_brief||''}}
  33. </view>
  34. <view class="money">
  35. <text>运费{{info.specs&&info.specs.length>0?info.specs[0].freight:0}}元</text>
  36. <text>{{info.goods.send_time}}内发货</text>
  37. </view>
  38. </view>
  39. <view class="one_4" @tap="toActivity">
  40. <view class="l">
  41. <text>{{info.act.length>0?`活动`:`暂无活动`}}</text>
  42. </view>
  43. <view class="r">
  44. <text class="iconfont icon-jiantouyou"></text>
  45. </view>
  46. </view>
  47. <view class="one_4" @tap="toSpec">
  48. <view class="l">
  49. 选择规格
  50. </view>
  51. <view class="r">
  52. <text class="iconfont icon-jiantouyou"></text>
  53. </view>
  54. </view>
  55. <view class="one_5" @tap="toEvaluate">
  56. <view class="l">
  57. <text>{{evaluate_num>0?`商品评价(${evaluate_num})`:`暂无评价`}}</text>
  58. </view>
  59. <view class="r">
  60. <text class="iconfont icon-jiantouyou"></text>
  61. </view>
  62. </view>
  63. <view class="one_6">
  64. <view class="one_6_1">
  65. <view class="shop_1">
  66. <image class="image"
  67. :src="info.shop.logo&&info.shop.logo.length>0?info.shop.logo[0].url:''"
  68. mode="aspectFit"></image>
  69. </view>
  70. <view class="shop_2">
  71. <view class="name">{{info.shop.name}}</view>
  72. <view class="num"><text>宝贝数:</text>{{info.shop.goods_num||0}}</view>
  73. </view>
  74. </view>
  75. <view class="one_6_2">
  76. <view class="score_1">
  77. <text>商品:</text>
  78. <text>{{info.shop.goods_score||5}}</text>
  79. <text>|</text>
  80. </view>
  81. <view class="score_1">
  82. <text>发货:</text>
  83. <text>{{info.shop.send_score||5}}</text>
  84. <text>|</text>
  85. </view>
  86. <view class="score_1">
  87. <text>服务:</text>
  88. <text>{{info.shop.service_score||5}}</text>
  89. </view>
  90. </view>
  91. <view class="one_6_3">
  92. <view class="btn">
  93. <button size="mini" @tap="toShop">进入店铺</button>
  94. </view>
  95. <view class="btn">
  96. <button size="mini" @tap="toShopcolect">{{shopColect==true?'已关注':'关注'}}</button>
  97. </view>
  98. </view>
  99. </view>
  100. <view class="one_7">
  101. <rich-text :nodes="info.goods.brief"></rich-text>
  102. </view>
  103. </view>
  104. </scroll-view>
  105. </view>
  106. <view class="two">
  107. <uni-goods-nav :options="options" :button-group="buttonGroup" @click="toNavleft"
  108. @buttonClick="toNavright" />
  109. </view>
  110. </view>
  111. <!-- 跳转菜单 -->
  112. <view class="bar_1">
  113. <text @tap="toMenubar" class="iconfont icon-gengduo"></text>
  114. </view>
  115. <view class="bar_2" v-if="is_menu">
  116. <view class="list" v-for="(item,index) in barList" :key="index" v-if="item.is_use=='0'"
  117. @click="toPath(item)">
  118. <image class="image" :src="item.normal&&item.normal.length>0?item.normal[0].url:''"></image>
  119. <text class="name"> {{item.name}}</text>
  120. </view>
  121. </view>
  122. <!-- 规格 -->
  123. <uni-popup ref="specShow" background-color="#fff" type="bottom" :is-mask-click="false">
  124. <view class="popup">
  125. <view class="close">
  126. <text @click="toClose" class="iconfont icon-shanchu"></text>
  127. </view>
  128. <view class="info_1" v-if="popupShow=='1'">
  129. <view class="info_1">
  130. <scroll-view scroll-y="true" class="scroll-view">
  131. <view class="list-scroll-view">
  132. <view class="one">
  133. <view class="one_1">
  134. <view class="l">
  135. <image class="image"
  136. :src="specsInfo.file.length>0?specsInfo.file[0].url:info.goods.file[0].url"
  137. mode="aspectFill" @tap="diaView"></image>
  138. </view>
  139. <view class="r">
  140. <view class="money">
  141. <text class="money_1"><text>¥</text>{{specsInfo.sell_money}}</text>
  142. <text class="money_1"><text>¥</text>{{specsInfo.flow_money}}</text>
  143. </view>
  144. <view class="other_1">
  145. <text>已选:</text>
  146. <text>{{specsInfo.name}}</text>
  147. </view>
  148. </view>
  149. </view>
  150. <view class="one_2">
  151. <view class="one_2_1">
  152. 规格
  153. </view>
  154. <view class="one_2_2">
  155. <view
  156. :class="['list',is_specs!=index&&item.num>0?'list':is_specs!=index&&item.num<=0?'huilist':is_specs==index&&item.num>0?'redlist':is_specs==index&&item.num<=0?'huiilist':'list']"
  157. v-for="(item,index) in info.specs" :key="index" @tap="toSpecs(item)">
  158. <text>{{item.name}}</text>
  159. </view>
  160. </view>
  161. </view>
  162. <view class="one_3">
  163. <view class="one_3_1">
  164. <text>数量</text>
  165. </view>
  166. <view class="one_3_1">
  167. <uni-number-box v-model="buy_num" @change="toCount" :min="1"
  168. :max="specsInfo.num">
  169. </uni-number-box>
  170. </view>
  171. <view class="one_3_1">
  172. <text>库存{{specsInfo.num||0}}</text>
  173. </view>
  174. </view>
  175. </view>
  176. </view>
  177. </scroll-view>
  178. </view>
  179. <view class="info_2">
  180. <view :class="[specsInfo.can_group=='0'?'btns':'btn']" v-if="btn_type=='0'">
  181. <button :disabled="is_zero" :class="[is_zero?'btncolor':'']" @tap="toMarket">加入购物车</button>
  182. </view>
  183. <view :class="[specsInfo.can_group=='0'?'btns':'btn']" v-if="btn_type=='1'">
  184. <button :disabled="is_zero" :class="[is_zero?'btncolor':'']" @tap="toBuy">立即购买</button>
  185. </view>
  186. <view :class="[specsInfo.can_group=='0'?'btns':'btn']" v-if="specsInfo.can_group=='0'">
  187. <button :disabled="is_zero" :class="[is_zero?'btncolor':'']" @tap="toGroup">参团</button>
  188. </view>
  189. </view>
  190. </view>
  191. <view class="info_3" v-else-if="popupShow=='2'">
  192. <scroll-view scroll-y="true" class="scroll-view">
  193. <view class="list" v-for="(item,index) in info.act" :key="index">
  194. <view class="list_1 textOver" @tap="toAct(item)">
  195. <view class="title_1">
  196. <view class="l">
  197. <text>{{item.tag||'暂无'}}</text>{{item.act_time.title}}
  198. </view>
  199. <view class="r">
  200. <text class="iconfont icon-jiantouyou"></text>
  201. </view>
  202. </view>
  203. <view class="title_2" v-if="item.type=='5'||item.type=='6'">
  204. <view class="text">{{item.text}}</view>
  205. <view class="time">{{item.config.time_start}}-{{item.config.time_end}}</view>
  206. </view>
  207. <view class="title_2" v-else-if="item.type=='2'">
  208. <view class="specList" v-for="(tag,indexx) in item.list" :key="indexx">
  209. <view class="name">规格:{{tag.spec_name}}</view>
  210. <view class="giftList" v-for="(tags,indexs) in tag.gift" :key="indexs"
  211. @tap.stop="tags.type=='0' && getDetail(tags)">
  212. <view class="left">
  213. <view class="goods">{{tags.goods_name}}{{tags.spec_name}}</view>
  214. <view class="goods">{{tags.desc}}</view>
  215. <view class="num">×{{tags.num}}</view>
  216. </view>
  217. <view class="right"><text class="iconfont icon-jiantouyou"></text>
  218. </view>
  219. </view>
  220. </view>
  221. </view>
  222. </view>
  223. </view>
  224. </scroll-view>
  225. </view>
  226. </view>
  227. </uni-popup>
  228. <view class="dialog" v-if="dialog.show==true" @tap="dialogClose">
  229. <view class="dialog_1" v-if="dialog.type=='1'">
  230. <swiper class="swiper" circular @change="diaSpecs" :current="is_specs">
  231. <swiper-item class="list" v-for="(item,index) in info.specs" :key="index">
  232. <view class="list_1">
  233. <image class="image" :src="item.file.length>0?item.file[0].url:info.goods.file[0].url"
  234. mode="aspectFill"></image>
  235. </view>
  236. <view class="name">
  237. <text>{{item.name}}</text>
  238. </view>
  239. </swiper-item>
  240. </swiper>
  241. </view>
  242. </view>
  243. </mobile-frame>
  244. </template>
  245. <script>
  246. export default {
  247. data() {
  248. return {
  249. // 系统设置
  250. config: {},
  251. // 商品id
  252. id: '',
  253. // 分享人id
  254. inviter: '',
  255. // 当前用户信息
  256. user: {},
  257. // 是否关注商品
  258. goodsColect: false,
  259. // 是否关注店铺
  260. shopColect: false,
  261. // 评价数
  262. evaluate_num: 2,
  263. // 商品详情
  264. info: {},
  265. // 底部菜单
  266. options: [ //
  267. {
  268. icon: 'shop',
  269. text: '店铺',
  270. type: 'shop',
  271. route: 'pagesHome/shop/index',
  272. },
  273. {
  274. icon: 'cart',
  275. text: '购物车',
  276. type: 'market',
  277. route: 'pages/market/index',
  278. },
  279. ],
  280. buttonGroup: [ //
  281. {
  282. text: '加入购物车',
  283. backgroundColor: 'linear-gradient(90deg, #FFCD1E, #FF8A18)',
  284. color: '#fff',
  285. type: '0'
  286. },
  287. {
  288. text: '立即购买',
  289. backgroundColor: 'linear-gradient(90deg, #FE6035, #EF1224)',
  290. color: '#fff',
  291. type: '1'
  292. }
  293. ],
  294. // 系统菜单
  295. barList: [],
  296. is_menu: false,
  297. // 规格弹框
  298. popupShow: '1',
  299. // 规格信息
  300. is_specs: 0,
  301. btn_type: '1',
  302. specsInfo: {},
  303. // 是否零库存
  304. is_zero: false,
  305. // 购买数量
  306. buy_num: 1,
  307. // 规格弹出框
  308. dialog: {
  309. show: false,
  310. type: '1'
  311. }
  312. };
  313. },
  314. onLoad: async function(e) {
  315. const that = this;
  316. that.$set(that, `id`, e.id || '');
  317. that.$set(that, `inviter`, e.inviter || '');
  318. await that.searchConfig();
  319. await that.search();
  320. await that.configShare();
  321. },
  322. onShow: async function() {
  323. const that = this;
  324. await that.watchLogin();
  325. },
  326. onUnload: function() {
  327. // 页面卸载,重新部署分享内容
  328. const that = this;
  329. if (that.config) {
  330. // 赋值默认值
  331. that.$config.share = {
  332. title: that.config.title,
  333. path: '/pages/index/index',
  334. imageUrl: that.config.config.share[0].url
  335. }
  336. }
  337. },
  338. methods: {
  339. // 查询系统设置
  340. searchConfig() {
  341. const that = this;
  342. uni.getStorage({
  343. key: 'config',
  344. success: function(res) {
  345. let data = res.data;
  346. that.$set(that, `config`, data);
  347. if (data.bottom_menu && data.bottom_menu.list.length > 0) {
  348. let list = data.bottom_menu.list.sort((a, b) => {
  349. return a.sort - b.sort
  350. });
  351. that.$set(that, `barList`, list)
  352. }
  353. }
  354. })
  355. },
  356. // 查询用户信息
  357. watchLogin() {
  358. const that = this;
  359. uni.getStorage({
  360. key: 'token',
  361. success: async function(res) {
  362. let user = that.$jwt(res.data);
  363. if (user) that.$set(that, `user`, user);
  364. await that.searchOther();
  365. },
  366. fail: function(err) {
  367. console.log('暂无用户信息');
  368. }
  369. })
  370. },
  371. // 查询其他信息
  372. async searchOther() {
  373. const that = this;
  374. let user = that.user;
  375. let res;
  376. // 是否关注商品
  377. res = await that.$api(`/storeGoods/check`, `GET`, {
  378. customer: user._id,
  379. goods: that.id
  380. });
  381. if (res.errcode == '0') that.$set(that, `goodsColect`, res.data);
  382. // 是否关注店铺
  383. res = await that.$api(`/storeShop/check`, `GET`, {
  384. customer: user._id,
  385. shop: that.info?.shop?._id
  386. });
  387. if (res.errcode == '0') that.$set(that, `shopColect`, res.data)
  388. },
  389. // 查询商品信息
  390. async search() {
  391. const that = this;
  392. let id = that.id;
  393. if (id) {
  394. let res;
  395. res = await that.$api(`/viewGoods/goodsDetail`, `POST`, {
  396. id: id
  397. });
  398. if (res.errcode == '0') {
  399. let data = res.data;
  400. if (data.goods.brief) data.goods.brief = data.goods.brief.replace(/\<img/gi,
  401. '<img class="rich-img"');
  402. let specs = data.specs.sort((a, b) => {
  403. return a.sell_money - b.sell_money
  404. })
  405. data.specs = specs;
  406. that.$set(that, `info`, data);
  407. // 查询规格
  408. that.searchSpecs(data.specs);
  409. // 查询评价数
  410. that.searchRate(data);
  411. }
  412. } else {
  413. uni.showToast({
  414. title: '暂无商品信息',
  415. icon: 'none'
  416. })
  417. }
  418. },
  419. // 查询规格
  420. searchSpecs(e) {
  421. const that = this;
  422. if (e.length > 0) {
  423. let data = e.find(i => i.num > 0);
  424. let dataIndex = e.findIndex(i => i.id == data.id);
  425. if (data) {
  426. that.$set(that, `specsInfo`, data);
  427. that.$set(that, `is_specs`, dataIndex);
  428. }
  429. }
  430. },
  431. // 活动说明
  432. toActivity() {
  433. const that = this;
  434. if (that.info.act.length > 0) {
  435. that.$set(that, `popupShow`, '2')
  436. that.$refs.specShow.open();
  437. }
  438. },
  439. // 查看正品详情
  440. getDetail(e) {
  441. const that = this;
  442. uni.navigateTo({
  443. url: `/pagesHome/order/detail?id=${e.goods}`
  444. })
  445. },
  446. // 选择规格
  447. toSpecs(e) {
  448. const that = this;
  449. let specs = that.info.specs;
  450. let dataIndex = specs.findIndex(i => i.id == e.id);
  451. that.$set(that, `is_specs`, dataIndex);
  452. that.$set(that, `specsInfo`, e)
  453. that.$set(that, `buy_num`, 1);
  454. if (e.num <= 0) that.$set(that, `is_zero`, true)
  455. else that.$set(that, `is_zero`, false)
  456. },
  457. // 计数器
  458. toCount(e) {
  459. const that = this;
  460. that.$set(that, `buy_num`, e)
  461. },
  462. // 查询评价数
  463. async searchRate(e) {
  464. const that = this;
  465. let res = await that.$api(`/goodsRate`, `GET`, {
  466. goods: e.goods._id
  467. })
  468. if (res.errcode == '0') that.$set(that, `evaluate_num`, res.total);
  469. },
  470. // 关注商品
  471. async toGoodscolect() {
  472. const that = this;
  473. let user = that.user;
  474. if (user && user._id) {
  475. let res = await that.$api(`/storeGoods`, `POST`, {
  476. customer: user._id,
  477. goods: that.id
  478. });
  479. if (res.errcode == '0') {
  480. uni.showToast({
  481. title: res.data.msg,
  482. icon: 'none'
  483. })
  484. that.$set(that, `goodsColect`, res.data.result)
  485. }
  486. } else {
  487. uni.showToast({
  488. title: '暂无账号,无法收藏商品',
  489. icon: 'none'
  490. })
  491. }
  492. },
  493. // 选择规格
  494. toSpec() {
  495. const that = this;
  496. this.$set(that, `popupShow`, '1')
  497. that.$refs.specShow.open();
  498. },
  499. // 加入购物车
  500. async toMarket() {
  501. const that = this;
  502. let user = that.user;
  503. let info = that.info;
  504. let specsInfo = that.specsInfo;
  505. if (user && user._id) {
  506. let obj = {
  507. customer: user._id,
  508. shop: info.shop._id,
  509. goods: info.goods._id,
  510. goodsSpec: specsInfo._id,
  511. num: that.buy_num,
  512. inviter: that.inviter
  513. }
  514. let res = await that.$api(`/cart`, 'POST', obj)
  515. if (res.errcode == '0') {
  516. uni.showToast({
  517. title: `加入购物车成功`,
  518. icon: 'none'
  519. })
  520. that.toClose();
  521. } else {
  522. uni.showToast({
  523. title: res.errmsg,
  524. icon: 'none'
  525. })
  526. }
  527. } else {
  528. uni.navigateTo({
  529. url: `/pages/login/index`
  530. })
  531. }
  532. },
  533. // 立即购买
  534. async toBuy() {
  535. const that = this;
  536. let user = that.user;
  537. let info = that.info;
  538. let specsInfo = that.specsInfo;
  539. if (user && user._id) {
  540. let obj = {
  541. customer: user._id,
  542. shop: info.shop._id,
  543. goods: info.goods._id,
  544. goodsSpec: specsInfo._id,
  545. num: that.buy_num,
  546. inviter: that.inviter
  547. }
  548. let res = await that.$api(`/util/checkCanBuy`, 'POST', obj)
  549. if (res.errcode == '0') {
  550. if (res.data.result == true) {
  551. uni.navigateTo({
  552. url: `/pagesHome/order/order?key=${res.data.key}`
  553. })
  554. } else {
  555. uni.showToast({
  556. title: res.data.msg,
  557. icon: 'none'
  558. })
  559. }
  560. } else {
  561. uni.showToast({
  562. title: res.errmsg,
  563. icon: 'none'
  564. })
  565. }
  566. } else {
  567. uni.navigateTo({
  568. url: `/pages/login/index`
  569. })
  570. }
  571. },
  572. // 参团
  573. toGroup() {
  574. const that = this;
  575. let specs_id = that.specsInfo._id;
  576. let id = that.id;
  577. uni.navigateTo({
  578. url: `/pagesHome/group/index?specs_id=${specs_id}&goods_id=${id}`
  579. })
  580. },
  581. // 关闭弹框
  582. toClose() {
  583. const that = this;
  584. that.$set(that, `btn_type`, '1');
  585. that.$refs.specShow.close();
  586. },
  587. // 评价
  588. toEvaluate() {
  589. const that = this;
  590. uni.navigateTo({
  591. url: `/pagesHome/order/appraise?id=${that.info.goods._id}`
  592. })
  593. },
  594. // 进入店铺
  595. toShop() {
  596. const that = this;
  597. let info = that.info;
  598. uni.navigateTo({
  599. url: `/pagesHome/shop/index?id=${info.shop._id}`
  600. })
  601. },
  602. // 关注店铺
  603. async toShopcolect() {
  604. const that = this;
  605. let user = that.user;
  606. if (user && user._id) {
  607. let res = await that.$api(`/storeShop`, `POST`, {
  608. customer: user._id,
  609. shop: that.info.shop._id
  610. });
  611. if (res.errcode == '0') {
  612. uni.showToast({
  613. title: res.data.msg,
  614. icon: 'none'
  615. })
  616. that.$set(that, `shopColect`, res.data.result)
  617. }
  618. } else {
  619. uni.showToast({
  620. title: '暂无账号,无法关注商铺',
  621. icon: 'none'
  622. })
  623. }
  624. },
  625. // 店铺,购物车
  626. toNavleft(e) {
  627. const that = this;
  628. if (e.content.type == 'shop') {
  629. that.toShop();
  630. } else if (e.content.type == 'market') {
  631. let obj = {
  632. route: e.content.route
  633. }
  634. that.toPath(obj)
  635. }
  636. },
  637. // 加入购物车,立即购买
  638. toNavright(e) {
  639. const that = this;
  640. that.$set(that, `popupShow`, '1');
  641. that.$set(that, `btn_type`, e.content.type);
  642. that.$refs.specShow.open();
  643. },
  644. // 右侧菜单
  645. toMenubar() {
  646. const that = this;
  647. that.$set(that, `is_menu`, that.is_menu ? false : true)
  648. },
  649. toPath(e) {
  650. let url = `/${e.route}`;
  651. uni.reLaunch({
  652. url
  653. })
  654. },
  655. // 配置分享内容
  656. configShare() {
  657. const that = this;
  658. let id = that.id;
  659. let inviter = that.user && that.user._id ? that.user._id : '';
  660. let title = that.info && that.info.goods ? that.info.goods.name : '';
  661. let imageUrl = that.info && that.info.goods ? that.info.goods.file[0].url : '';
  662. that.$config.share = {
  663. title: title,
  664. path: `/pagesHome/order/detail?id=${id}&inviter=${inviter}`,
  665. imageUrl: imageUrl
  666. }
  667. },
  668. // 规格预览
  669. diaView() {
  670. const that = this;
  671. that.$set(that, `dialog`, {
  672. show: true,
  673. type: '1'
  674. })
  675. },
  676. // 查看活动
  677. toAct(item) {
  678. uni.navigateTo({
  679. url: `/pagesRest/activity/info?id=${item._id}`
  680. })
  681. },
  682. // 弹框选择规格
  683. diaSpecs(e) {
  684. const that = this;
  685. let specs = that.info.specs;
  686. let index = e.detail.current;
  687. let data = specs[index];
  688. that.$set(that, `is_specs`, index);
  689. that.$set(that, `specsInfo`, data);
  690. that.$set(that, `buy_num`, 1);
  691. if (data.num <= 0) that.$set(that, `is_zero`, true)
  692. else that.$set(that, `is_zero`, false)
  693. },
  694. // 关闭弹框
  695. dialogClose() {
  696. const that = this;
  697. that.$set(that, `dialog`, {
  698. show: false,
  699. type: '1'
  700. })
  701. }
  702. }
  703. }
  704. </script>
  705. <style lang="scss">
  706. .main {
  707. display: flex;
  708. flex-direction: column;
  709. width: 100vw;
  710. height: 100vh;
  711. .one {
  712. position: relative;
  713. flex-grow: 1;
  714. .one_1 {
  715. border-bottom: 0.5vw solid var(--f9Color);
  716. swiper {
  717. height: 44vh !important;
  718. }
  719. .list {
  720. border-radius: 5px;
  721. .image {
  722. width: 100%;
  723. height: 100%;
  724. border-radius: 5px;
  725. background-color: #fff;
  726. }
  727. }
  728. .goodsColect {
  729. position: fixed;
  730. top: 2vw;
  731. right: 3vw;
  732. background-color: #858585;
  733. border-radius: 90px;
  734. text {
  735. font-size: 30px;
  736. }
  737. }
  738. }
  739. .one_2 {
  740. border-bottom: 0.5vw solid var(--f9Color);
  741. padding: 2vw;
  742. .money {
  743. font-size: 20px;
  744. padding: 0 1vw 0 0;
  745. color: #ff0000;
  746. font-weight: bold;
  747. text {
  748. font-size: 14px;
  749. }
  750. }
  751. .money:last-child {
  752. font-size: 16px;
  753. color: #858585;
  754. text-decoration: line-through;
  755. }
  756. }
  757. .one_3 {
  758. border-bottom: 0.5vw solid var(--f9Color);
  759. padding: 2vw;
  760. .name {
  761. font-size: 17px;
  762. font-weight: bold;
  763. margin: 0 0 2vw 0;
  764. }
  765. .brief {
  766. font-size: 14px;
  767. color: #858585;
  768. margin: 0 0 1vw 0;
  769. }
  770. .money {
  771. font-size: 13px;
  772. color: #858585;
  773. text {
  774. padding: 0 2vw 0 0;
  775. }
  776. }
  777. }
  778. .one_4 {
  779. display: flex;
  780. justify-content: space-between;
  781. padding: 2vw;
  782. border-bottom: 0.5vw solid var(--f9Color);
  783. font-size: 14px;
  784. }
  785. .one_5 {
  786. display: flex;
  787. justify-content: space-between;
  788. padding: 2vw;
  789. border-bottom: 0.5vw solid var(--f9Color);
  790. font-size: 14px;
  791. }
  792. .one_6 {
  793. padding: 2vw;
  794. border-bottom: 0.5vw solid var(--f9Color);
  795. .one_6_1 {
  796. margin: 0 0 1vw 0;
  797. display: flex;
  798. .shop_1 {
  799. width: 15vw;
  800. height: 15vw;
  801. border: 1px solid #f1f1f1;
  802. .image {
  803. width: 100%;
  804. height: 100%;
  805. }
  806. }
  807. .shop_2 {
  808. width: 78vw;
  809. padding: 0 0 0 2vw;
  810. .name {
  811. font-size: 14px;
  812. margin: 0 0 1vw 0;
  813. }
  814. .num {
  815. font-size: 12px;
  816. color: #858585;
  817. text:last-child {
  818. color: #000;
  819. }
  820. }
  821. }
  822. }
  823. .one_6_2 {
  824. margin: 0 0 2vw 0;
  825. display: flex;
  826. justify-content: space-between;
  827. padding: 2vw 0;
  828. .score_1 {
  829. width: 33vw;
  830. text-align: center;
  831. font-size: 14px;
  832. color: #858585;
  833. text:nth-child(2) {
  834. color: #ff0000;
  835. }
  836. text:nth-child(3) {
  837. float: right;
  838. }
  839. }
  840. }
  841. .one_6_3 {
  842. display: flex;
  843. justify-content: space-around;
  844. .btn {
  845. width: 40vw;
  846. button {
  847. width: 100%;
  848. font-size: 15px;
  849. }
  850. }
  851. }
  852. }
  853. .one_7 {
  854. padding: 2vw;
  855. .rich-img {
  856. width: 100% !important;
  857. display: block;
  858. }
  859. }
  860. }
  861. .two {
  862. width: 100vw;
  863. height: 8vh;
  864. overflow: hidden;
  865. }
  866. }
  867. .scroll-view {
  868. position: absolute;
  869. top: 0;
  870. left: 0;
  871. right: 0;
  872. bottom: 0;
  873. .list-scroll-view {
  874. display: flex;
  875. flex-direction: column;
  876. }
  877. }
  878. .bar_1 {
  879. position: fixed;
  880. right: 2vw;
  881. bottom: 20vw;
  882. text {
  883. background-color: #858585;
  884. border-radius: 90px;
  885. font-size: 30px;
  886. }
  887. }
  888. .bar_2 {
  889. position: fixed;
  890. right: 2vw;
  891. bottom: 28vw;
  892. width: 27vw;
  893. background: #ffffff;
  894. padding: 0 2vw;
  895. box-shadow: 0 0 5px #858585;
  896. .list {
  897. display: flex;
  898. border-bottom: 1px solid #f1f1f1;
  899. padding: 1vw 0;
  900. .image {
  901. width: 8vw;
  902. height: 8vw;
  903. }
  904. .name {
  905. font-size: 14px;
  906. position: relative;
  907. top: 2vw;
  908. left: 2vw;
  909. }
  910. }
  911. .list:last-child {
  912. border-bottom: none;
  913. }
  914. }
  915. .uni-popup {
  916. z-index: 9999 !important;
  917. }
  918. .popup {
  919. display: flex;
  920. flex-direction: column;
  921. width: 100vw;
  922. height: 60vh;
  923. .close {
  924. text-align: right;
  925. padding: 2vw;
  926. }
  927. .info_1 {
  928. position: relative;
  929. display: flex;
  930. flex-direction: column;
  931. height: 54vh;
  932. .info_1 {
  933. position: relative;
  934. flex-grow: 1;
  935. .one {
  936. padding: 2vw;
  937. .one_1 {
  938. display: flex;
  939. margin: 0 0 2vw 0;
  940. padding: 0 0 2vw 0;
  941. border-bottom: 0.5vw solid var(--f9Color);
  942. .l {
  943. width: 25vw;
  944. height: 25vw;
  945. .image {
  946. width: 100%;
  947. height: 100%;
  948. border-radius: 5px;
  949. }
  950. }
  951. .r {
  952. width: 70vw;
  953. padding: 0 0 0 2vw;
  954. .money {
  955. margin: 0 0 2vw 0;
  956. .money_1 {
  957. font-size: 20px;
  958. color: #ff0000;
  959. padding: 0 2vw 0 0;
  960. text {
  961. font-size: 14px;
  962. }
  963. }
  964. .money_1:last-child {
  965. font-size: 16px;
  966. color: #858585;
  967. text-decoration: line-through;
  968. }
  969. }
  970. .other_1 {
  971. font-size: 15px;
  972. color: #858585;
  973. text:last-child {
  974. color: #000000;
  975. }
  976. }
  977. }
  978. }
  979. .one_2 {
  980. margin: 0 0 2vw 0;
  981. border-bottom: 0.5vw solid var(--f9Color);
  982. .one_2_1 {
  983. font-size: 14px;
  984. margin: 0 0 2vw 0;
  985. }
  986. .one_2_2 {
  987. display: flex;
  988. flex-wrap: wrap;
  989. .list {
  990. background-color: #F5F5F5;
  991. margin: 0 2vw 2vw 0;
  992. padding: 0.5vw 1vw;
  993. border-radius: 5px;
  994. text {
  995. font-size: 14px;
  996. color: #000;
  997. }
  998. }
  999. .huilist {
  1000. background-color: #DCDCDC;
  1001. text {
  1002. color: #858585;
  1003. }
  1004. }
  1005. .redlist {
  1006. background-color: #ff0000;
  1007. text {
  1008. color: #ffffff;
  1009. }
  1010. }
  1011. .huiilist {
  1012. background-color: #808080;
  1013. text {
  1014. color: #cccccc;
  1015. }
  1016. }
  1017. }
  1018. }
  1019. .one_3 {
  1020. display: flex;
  1021. .one_3_1 {
  1022. margin: 0 2vw 0 0;
  1023. text {
  1024. font-size: 14px;
  1025. color: #858585;
  1026. }
  1027. }
  1028. }
  1029. }
  1030. }
  1031. .info_2 {
  1032. display: flex;
  1033. text-align: center;
  1034. justify-content: space-between;
  1035. .btns {
  1036. width: 50vw;
  1037. }
  1038. .btn {
  1039. width: 100vw;
  1040. }
  1041. button {
  1042. width: 100%;
  1043. border-radius: 0;
  1044. background-color: var(--fFB1Color);
  1045. color: #fff;
  1046. border: 1px solid #f1f1f1;
  1047. }
  1048. .btncolor {
  1049. background: #f1f1f1;
  1050. color: #858585;
  1051. }
  1052. }
  1053. }
  1054. .info_3 {
  1055. position: relative;
  1056. flex-grow: 1;
  1057. .list {
  1058. margin: 0 2vw 2vw 2vw;
  1059. border-radius: 10px;
  1060. background-color: #FFF8DC;
  1061. .list_1 {
  1062. padding: 2vw;
  1063. font-size: 14px;
  1064. .title_1 {
  1065. display: flex;
  1066. justify-content: space-between;
  1067. margin: 1vw 0;
  1068. .l {
  1069. text {
  1070. margin: 0 1vw 0 0;
  1071. font-size: 12px;
  1072. border-radius: 5px;
  1073. border: 0.5px solid var(--fFB1Color);
  1074. color: var(--fFB1Color);
  1075. }
  1076. }
  1077. }
  1078. .title_2 {
  1079. .specList {
  1080. .name {
  1081. margin: 0 0 1vw 0;
  1082. }
  1083. .giftList {
  1084. width: 90vw;
  1085. display: flex;
  1086. justify-content: space-between;
  1087. align-items: center;
  1088. margin: 0 0 1vw 0;
  1089. border: 0.5px solid var(--f9Color);
  1090. border-radius: 10px;
  1091. .left {
  1092. width: 85vw;
  1093. .goods {
  1094. overflow: hidden;
  1095. text-overflow: ellipsis;
  1096. display: -webkit-box;
  1097. -webkit-line-clamp: 2;
  1098. -webkit-box-orient: vertical;
  1099. }
  1100. }
  1101. }
  1102. }
  1103. .text {
  1104. color: var(--fFB1Color);
  1105. }
  1106. }
  1107. }
  1108. }
  1109. }
  1110. }
  1111. .dialog {
  1112. position: fixed;
  1113. width: 100vw;
  1114. height: 100vh;
  1115. background-color: #000000;
  1116. z-index: 99999;
  1117. display: flex;
  1118. flex-direction: column;
  1119. justify-content: center;
  1120. swiper {
  1121. height: 60vh;
  1122. }
  1123. .list {
  1124. .list_1 {
  1125. background-color: #fff;
  1126. padding: 2vw;
  1127. margin: 0 0 5vw 0;
  1128. .image {
  1129. width: 100%;
  1130. height: 40vh;
  1131. }
  1132. }
  1133. .name {
  1134. text-align: center;
  1135. margin: 0 10vw;
  1136. background-color: #6666669f;
  1137. border-radius: 25px;
  1138. padding: 2vw;
  1139. text {
  1140. color: #fff;
  1141. font-size: 15px;
  1142. overflow: hidden;
  1143. text-overflow: ellipsis;
  1144. -webkit-line-clamp: 2;
  1145. word-break: break-all;
  1146. display: -webkit-box;
  1147. -webkit-box-orient: vertical;
  1148. }
  1149. }
  1150. }
  1151. }
  1152. </style>