detail.vue 30 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108
  1. <template>
  2. <view class="content">
  3. <u-navbar title=" " @leftClick="leftClick" height="44px" bgColor="#F5F5F5" :placeholder="true">
  4. <view class="hflex acenter" slot="center">
  5. <view class="nav_item" @click="changeNav(1)" :class="nav_active == 1?'nav_active': '' ">商品</view>
  6. <view class="nav_item" @click="changeNav(2)" :class="nav_active == 2?'nav_active': '' ">详情</view>
  7. </view>
  8. </u-navbar>
  9. <view class="swiper">
  10. <u-swiper :list="pageData.cover" height="300" @change="e => currentNum = e.current" :autoplay="false" indicatorStyle="right: 20px">
  11. <view slot="indicator" class="indicator-num">
  12. <text class="indicator-num__text">{{ currentNum + 1 }}/{{ len >= 0 ? len : 0}}</text>
  13. </view>
  14. </u-swiper>
  15. </view>
  16. <view class="box">
  17. <view class="hflex acenter jbetween">
  18. <view class="price">¥{{pageData.price_selling}}</view>
  19. <view class="hflex acenter">
  20. <view class="vflex acenter" @click="collect">
  21. <u-icon name="star" color="#444444" size="20" v-if="pageData.is_collection == 0"></u-icon>
  22. <u-icon name="star-fill" color="#506DFF" size="20" v-else></u-icon>
  23. <view class="text_style1">收藏</view>
  24. </view>
  25. <view class="vflex acenter" style="margin-left: 42rpx;" @click="share('Poster1')">
  26. <image src="https://ship-expert.zhousi.hdlkeji.com/common/share.png" class="bottom_img"></image>
  27. <view class="text_style1">分享</view>
  28. </view>
  29. </view>
  30. </view>
  31. <view class="name">{{pageData.name}}</view>
  32. </view>
  33. <view class="box">
  34. <view class="hflex acenter jbetween" @click="openNorm">
  35. <view class="hflex acenter">
  36. <view class="label">选择</view>
  37. <view class="text_style2">{{normStr?normStr:'选择规格'}}</view>
  38. </view>
  39. <u-icon name="arrow-right" color="#000" size="14"></u-icon>
  40. </view>
  41. <view class="hflex acenter jbetween pad-20" @click="openAddr">
  42. <view class="hflex acenter">
  43. <view class="label">配送</view>
  44. <view class="text_style2">{{delivery?delivery:'选择配送地址'}}</view>
  45. </view>
  46. <u-icon name="arrow-right" color="#000" size="14"></u-icon>
  47. </view>
  48. </view>
  49. <view class="box1">
  50. <view class="title">商品图文详情</view>
  51. <!-- <block v-for="(item,index) in pageData.detail" :key="index">
  52. <image :src="item" mode="widthFix" class="detail_img"></image>
  53. </block> -->
  54. <u-parse :content="pageData.content"></u-parse>
  55. <view class="vflex acenter jcenter">
  56. <view v-for="(item,index) in pageData.slider" :key="index" class="cell">
  57. <image :src="item.url" style="width: 100%;" mode="aspectFit" v-if="item.type == 'img'"></image>
  58. <video :src="item.url" v-else></video>
  59. </view>
  60. </view>
  61. </view>
  62. <view class="bottom hflex acenter jbetween">
  63. <view class="vflex acenter" @click="toShop">
  64. <image src="/static/images/shop/shop_icon.png" class="bottom_img"></image>
  65. <view class="text_style1">店铺</view>
  66. </view>
  67. <view class="vflex acenter" @click="into_chatroom">
  68. <image src="/static/images/shop/customer_icon.png" class="bottom_img"></image>
  69. <view class="text_style1">客服</view>
  70. <!-- <button class="text_style1" style="border: none;background: rgba(0, 0, 0, 0);" open-type="contact" @contact="handleContact">客服</button> -->
  71. </view>
  72. <view class="vflex acenter" @click="toCart">
  73. <image src="/static/images/shop/cart_icon.png" class="bottom_img"></image>
  74. <view class="text_style1">购物车</view>
  75. </view>
  76. <view class="hflex acenter">
  77. <view class="btn1" @click="addCart">加入购物车</view>
  78. <view class="btn2" @click="buy">立即购买</view>
  79. </view>
  80. </view>
  81. <u-popup :show="norm_show" @close="close" mode="bottom" :round="20" :closeable="true">
  82. <view class="popu">
  83. <view class="hflex acenter">
  84. <image :src="pageData.items[norm_active].show_image?pageData.items[norm_active].show_image:pageData.cover" class="popu_img" mode="aspectFill"></image>
  85. <view class="vflex jbetween popu_right">
  86. <view class="popu_price">¥{{pageData.items[norm_active].price_selling?pageData.items[norm_active].price_selling:pageData.price_selling}}</view>
  87. <view class="popu_norm text_hide">{{normStr?normStr:'选择规格'}}</view>
  88. </view>
  89. </view>
  90. <view class="" v-for="(item,index) in pageData.specs" :key="index">
  91. <view class="popu_title">{{item.name}}</view>
  92. <view class="hflex acenter fwrap">
  93. <block v-for="(item2,index2) in item.list" :key="index2">
  94. <view class="popu_box" @click="selectNorm(index,index2)" :class="item2.select?'sele_active':''" v-if="item2.show && item2.check">{{item2.name}}</view>
  95. <view class="popu_box popu_box2" v-else @click="selectNorm2">{{item2.name}}</view>
  96. </block>
  97. </view>
  98. </view>
  99. <view class="hflex acenter jbetween">
  100. <view class="popu_title">数量</view>
  101. <u-number-box v-model="pageData.num" @change="changeNum"></u-number-box>
  102. </view>
  103. <view class="sure_btn" @click="sure">确定</view>
  104. </view>
  105. </u-popup>
  106. <u-popup :show="addr_show" @close="close" mode="bottom" :round="20" :closeable="true">
  107. <view class="popu">
  108. <view class="hflex acenter jcenter popu_title" style="text-align: center;">配送地址</view>
  109. <view v-if="deliveryList.length > 0">
  110. <block v-for="(item,index) in deliveryList" :key="index">
  111. <view class="box_bg hflex acenter" @click="selectAddr(index)">
  112. <image v-if="item.checked == 1" src="/static/images/shop/checked.png" class="check_img"></image>
  113. <u-icon v-else name="map-fill" color="#b2b2b2" size="12"></u-icon>
  114. <view class="popu_right2">
  115. <view class="hflex acenter">
  116. <view class="popu_name">{{item.name}}</view>
  117. <view class="popu_phone">{{item.phone}}</view>
  118. </view>
  119. <view class="popu_addr">{{item.province}} {{item.city}} {{item.area}} {{item.address}}</view>
  120. </view>
  121. </view>
  122. </block>
  123. </view>
  124. <view class="address vflex acenter jcenter" v-else>
  125. <image src="/static/images/shop/no_addr.png" class="address_img"></image>
  126. <view class="address_text">暂无地址</view>
  127. </view>
  128. <view class="sure_btn" @click="select">选择其他收货地址</view>
  129. </view>
  130. </u-popup>
  131. <view class="share_content" :class="share_show?'':'share_content1'">
  132. <view class="share_box vflex">
  133. <image class="Poster1 cover" :data-enode="pageData.cover[0]" data-etype="image" :src="pageData.cover[0]"></image>
  134. <view class="Poster1 share_price" :data-enode="'¥' + pageData.price_selling">¥{{pageData.price_selling}}</view>
  135. <view class="Poster1 share_name text_hide" :data-enode="pageData.name">{{pageData.name}}</view>
  136. <view class="hflex acenter share_text jcenter Poster1" style=" margin: 0 200rpx 12rpx;" data-enode="长按或扫码查看">长按或扫码查看</view>
  137. <view style="width: 100%;" class="vflex acenter jcenter">
  138. <image class="Poster1" style="width: 25rpx;height: 20rpx;" :data-enode="style.img1" data-etype="image" :src="style.img1"></image>
  139. <image class="Poster1" style="width: 100%;height: 2rpx;margin: 30rpx 0;" :data-enode="style.img2" data-etype="image" :src="style.img2"></image>
  140. </view>
  141. <view class="hflex acenter jbetween">
  142. <view class="vflex">
  143. <view class="share_name Poster1" style="margin: 54rpx 20rpx 20rpx;" data-enode="船百知">船百知</view>
  144. <view class="share_text Poster1" style="margin: 0 20rpx 36rpx;" data-enode="船百知伴你一起杨帆启航,驶向成功彼岸">船百知伴你一起杨帆启航,驶向成功彼岸</view>
  145. </view>
  146. <image class="Poster1" data-etype="image" :data-enode="style.code" :src="style.code" style="width: 136rpx;height: 136rpx;"></image>
  147. </view>
  148. </view>
  149. <evils-el-poster width="325" height="520" @on-error="onError" :list="list" backgroundColor="rgb(255, 255, 255)" @on-success="onSuccess" ref="Eposter"></evils-el-poster>
  150. <view class="share_bottom">
  151. <view class="hflex acenter jcenter">
  152. <button class="vflex acenter jcenter bottom_item" open-type="share">
  153. <image src="https://ship-expert.zhousi.hdlkeji.com/common/wx.png" class="item_icon"></image>
  154. <view class="item_text">微信好友</view>
  155. </button>
  156. <!-- <button class="vflex acenter jcenter bottom_item" open-type="share">
  157. <image src="https://ship-expert.zhousi.hdlkeji.com/common/moments.png" class="item_icon"></image>
  158. <view class="item_text">朋友圈</view>
  159. </button> -->
  160. <view class="vflex acenter jcenter bottom_item" @click="saveImg">
  161. <image src="https://ship-expert.zhousi.hdlkeji.com/common/download.png" class="item_icon"></image>
  162. <view class="item_text">保存图片</view>
  163. </view>
  164. </view>
  165. <view class="share_cancel" @click="closed">取消</view>
  166. </view>
  167. </view>
  168. </view>
  169. </template>
  170. <script>
  171. import $api from '@/static/js/api.js'
  172. var that = ''
  173. export default {
  174. data() {
  175. return {
  176. nav_active: 1,
  177. currentNum: 0,
  178. pageData: {
  179. },
  180. normStr: '',
  181. norm: '',
  182. color: '',
  183. delivery: '',
  184. deliveryList: [],
  185. address_active: 0,
  186. norm_show: false,
  187. addr_show: false,
  188. norm_active: -1,
  189. color_active:-1,
  190. is_buy: 0,
  191. id: '',
  192. order_no: '',
  193. list: [],
  194. style: {
  195. img1: 'https://ship-expert.zhousi.hdlkeji.com/common/down2.png',
  196. img2: 'https://ship-expert.zhousi.hdlkeji.com/common/line.png',
  197. code: 'https://ship-expert.zhousi.hdlkeji.com/common/code.jpg'
  198. },
  199. share_show: false,
  200. tempImage:'',
  201. item_id: '',
  202. normType: 0,
  203. len: 0,
  204. max_num: 1
  205. }
  206. },
  207. onLoad(options) {
  208. that = this
  209. that.id = options.id
  210. that.getData()
  211. },
  212. onShow() {
  213. that.getAddr()
  214. },
  215. onPageScroll(e) {
  216. if(e.scrollTop < 530) {
  217. that.nav_active = 1
  218. } else {
  219. that.nav_active = 2
  220. }
  221. },
  222. onShareAppMessage(res) {
  223. console.log(res);
  224. if (res.from === 'button') {// 来自页面内分享按钮
  225. console.log(res.target)
  226. }
  227. return {
  228. title: '船百知', //分享的名称
  229. }
  230. },
  231. onShareTimeline(res) {
  232. console.log(res);
  233. return {
  234. title: '船百知',
  235. type: 0,
  236. summary: "",
  237. }
  238. },
  239. methods: {
  240. getData() {
  241. $api.req({
  242. url: '/data/api.Goods/Goods_info',
  243. data: {
  244. goods_id: that.id
  245. }
  246. }, function(res) {
  247. if(res.code == 1) {
  248. that.pageData = res.data
  249. var slider = []
  250. that.pageData.cover = that.pageData.cover.split('|')
  251. that.len = that.pageData.cover.length
  252. for(var i=0;i<that.pageData.slider.length;i++) {
  253. var temp = that.pageData.slider[i].substr(-3,3)
  254. var sliders = ''
  255. if(temp == 'jpg' || temp == "png") {
  256. sliders = "img"
  257. } else {
  258. sliders = 'video'
  259. }
  260. console.log(sliders);
  261. var data = {
  262. type: sliders,
  263. url: that.pageData.slider[i]
  264. }
  265. slider.push(data)
  266. }
  267. that.pageData.slider = slider
  268. console.log(that.pageData);
  269. that.$set(that.pageData,'num',1)
  270. }
  271. })
  272. },
  273. getAddr() {
  274. $api.req({
  275. url: '/data/api.User/address_list'
  276. }, function(res) {
  277. if(res.code == 1) {
  278. that.deliveryList = res.data.data
  279. var address_id = uni.getStorageSync('address_id')
  280. for(var i=0;i<that.deliveryList.length;i++) {
  281. if(that.deliveryList[i].id == address_id) {
  282. that.delivery = that.deliveryList[i].province+that.deliveryList[i].city+that.deliveryList[i].area
  283. that.$set(that.deliveryList[i],'checked',true)
  284. that.address_active = i
  285. } else {
  286. that.$set(that.deliveryList[i],'checked',false)
  287. }
  288. }
  289. }
  290. })
  291. },
  292. // 返回
  293. leftClick() {
  294. $api.jump(-1)
  295. },
  296. // 切换导航栏
  297. changeNav(index) {
  298. that.nav_active = index
  299. if(index == 1) {
  300. uni.pageScrollTo({
  301. scrollTop: 0,
  302. duration: 300
  303. });
  304. } else {
  305. uni.pageScrollTo({
  306. scrollTop: 530,
  307. duration: 300
  308. });
  309. }
  310. },
  311. // 收藏
  312. collect() {
  313. if(that.pageData.is_collection == 0) {
  314. that.pageData.is_collection = 1
  315. $api.req({
  316. url: '/data/api.Goods/collection',
  317. data: {
  318. goods_id: that.pageData.id,
  319. }
  320. }, function(res) {
  321. if(res.code == 1) {
  322. $api.info(res.info)
  323. }
  324. })
  325. // $api.info('收藏成功')
  326. } else {
  327. that.pageData.is_collection = 0
  328. $api.req({
  329. url: '/data/api.Goods/cancel_collection',
  330. data: {
  331. goods_id: that.pageData.id,
  332. }
  333. }, function(res) {
  334. if(res.code == 1) {
  335. $api.info(res.info)
  336. }
  337. })
  338. }
  339. },
  340. share(elClass) {
  341. let view = uni.createSelectorQuery().in(this).select(".Poster1");
  342. view.fields({
  343. size: true,
  344. rect: true,
  345. scrollOffset: true
  346. }, data => {
  347. }).exec();
  348. that.share_show = true
  349. that.$refs.Eposter.createForElRect(elClass,false)
  350. },
  351. // 打开规格
  352. openNorm() {
  353. that.norm_show = true
  354. that.normType = 1
  355. },
  356. // 打开配送
  357. openAddr() {
  358. that.addr_show = true
  359. },
  360. // 选择规格
  361. selectNorm(index,index2) {
  362. for(var i=0;i<that.pageData.specs[index].list.length;i++) {
  363. if(i == index2) {
  364. that.$set(that.pageData.specs[index].list[i],'select',true)
  365. } else {
  366. that.$set(that.pageData.specs[index].list[i],'select',false)
  367. }
  368. }
  369. that.normStr = ''
  370. that.item_id = ''
  371. for(var i=0;i<that.pageData.specs.length;i++) {
  372. for(var j=0;j<that.pageData.specs[i].list.length;j++) {
  373. if(that.pageData.specs[i].list[j].select) {
  374. that.normStr += that.pageData.specs[i].name+'::'+that.pageData.specs[i].list[j].name+';;'
  375. // that.item_id +=
  376. }
  377. }
  378. }
  379. that.normStr = that.normStr.substring(0, that.normStr.length-2)
  380. for(var i=0;i<that.pageData.items.length;i++) {
  381. if(that.pageData.items[i].goods_spec == that.normStr) {
  382. that.norm_active = i
  383. that.max_num = that.pageData.items[that.norm_active].stock_total
  384. that.normStr = $api.resetspec(that.normStr)
  385. return
  386. } else {
  387. that.norm_active = -1
  388. }
  389. }
  390. that.normStr = $api.resetspec(that.normStr)
  391. // that.norm_active = index2
  392. // that.normStr = that.pageData.items[index].goods_spec
  393. // that.normStr = that.norm + ' ' + that.color + ' ' + 'X' + that.pageData.norm.num
  394. },
  395. selectNorm2() {
  396. $api.info('该规格已下架,请重新选择')
  397. },
  398. // 选择颜色
  399. selectColor(index) {
  400. that.color_active = index
  401. that.color = that.pageData.norm.colorList[index].name
  402. that.normStr = that.norm + ' ' + that.color + ' ' + 'X' + that.pageData.norm.num
  403. },
  404. // 选择数量
  405. changeNum(e) {
  406. that.pageData.num = e.value
  407. },
  408. // 选择地址
  409. selectAddr(index) {
  410. for(var i=0;i<that.deliveryList.length;i++) {
  411. if(i == index) {
  412. console.log(i);
  413. that.$set(that.deliveryList[i],'checked',1)
  414. that.address_active = i
  415. that.delivery = that.deliveryList[i].province+that.deliveryList[i].city+that.deliveryList[i].area + that.deliveryList[i].address
  416. that.close()
  417. } else {
  418. that.$set(that.deliveryList[i],'checked',0)
  419. }
  420. }
  421. },
  422. // 加入购物车
  423. addCart() {
  424. if(that.max_num < that.pageData.num) {
  425. $api.info("商品库存不足")
  426. return
  427. }
  428. if(that.norm == '' && that.color == '') {
  429. that.is_buy = 0
  430. that.norm_show = true
  431. // that.openNorm()
  432. } else {
  433. $api.req({
  434. url: '/data/api.Goods/cart_add',
  435. method: 'POST',
  436. data: {
  437. admin_id: that.pageData.admin_id,
  438. goods_id: that.pageData.id,
  439. item_id: that.pageData.items[that.norm_active].id,
  440. num: that.pageData.num
  441. }
  442. }, function(res) {
  443. if(res.code == 1) {
  444. $api.info('加入购物车成功')
  445. that.close()
  446. }
  447. })
  448. }
  449. },
  450. // 立即购买
  451. buy() {
  452. /* if(that.deliveryList.length == 0) {
  453. $api.info('请先选择配送地址')
  454. return
  455. } */
  456. if(that.max_num < that.pageData.num) {
  457. $api.info("商品库存不足")
  458. return
  459. }
  460. console.log(that.norm_active);
  461. if(that.norm_active == -1) {
  462. that.is_buy = 1
  463. that.norm_show = true
  464. } else {
  465. var url = ''
  466. var data = {
  467. admin_id: that.pageData.admin_id,
  468. admin_name: that.pageData.admin_name,
  469. code: that.pageData.code,
  470. create_at: that.pageData.create_at,
  471. cover: that.pageData.cover,
  472. id: that.pageData.id,
  473. items: that.pageData.items,
  474. name: that.pageData.name,
  475. num_read: that.pageData.num_read,
  476. price_selling: that.pageData.price_selling,
  477. price_market: that.pageData.price_market,
  478. }
  479. if(that.deliveryList.length>0) {
  480. url = '/page_shop/pages/good/submit?pageData=' + JSON.stringify(data) + '&item_id=' + that.norm_active + '&buy_num=' + that.pageData.num + '&address_id=' + that.deliveryList[that.address_active].id
  481. } else {
  482. url = '/page_shop/pages/good/submit?pageData=' + JSON.stringify(data) + '&item_id=' + that.norm_active + '&buy_num=' + that.pageData.num
  483. }
  484. $api.jump(url)
  485. /* $api.req({
  486. url: '/data/api.Order/order_create',
  487. method: 'POST',
  488. data: {
  489. admin_id: that.pageData.admin_id,
  490. item_id: that.pageData.items[that.norm_active].id,
  491. num: that.pageData.num,
  492. address_id: that.deliveryList[that.address_active].id
  493. }
  494. }, function(res) {
  495. if(res.code == 1) {
  496. $api.info(res.info)
  497. that.close()
  498. var order_id = res.data.order_id
  499. var pay_no = res.data.pay_no
  500. $api.jump('/page_shop/pages/good/submit?order_id=' + order_id + '&address_id=' + that.deliveryList[that.address_active].id + '&pay_no=' +pay_no)
  501. }
  502. }) */
  503. }
  504. },
  505. // 确定选择规格
  506. sure() {
  507. if(that.max_num < that.pageData.num) {
  508. $api.info("商品库存不足")
  509. return
  510. }
  511. for(var i=0;i<that.pageData.specs.length;i++) {
  512. for(var j=0;j<that.pageData.specs[i].list.length;j++) {
  513. if(!that.pageData.specs[i].list[j].select && that.norm_active == -1) {
  514. $api.info('该规格已下架,请重新选择')
  515. return
  516. }
  517. }
  518. }
  519. console.log(that.norm_active);
  520. if(that.norm_active == -1) {
  521. $api.info('请选择规格')
  522. return
  523. }
  524. if(that.normType == 1) {
  525. that.close()
  526. return
  527. }
  528. if(that.is_buy == 0) {
  529. $api.req({
  530. url: '/data/api.Goods/cart_add',
  531. method: 'POST',
  532. data: {
  533. admin_id: that.pageData.admin_id,
  534. goods_id: that.pageData.id,
  535. item_id: that.pageData.items[that.norm_active].id,
  536. num: that.pageData.num
  537. }
  538. }, function(res) {
  539. if(res.code == 1) {
  540. $api.info('加入购物车成功')
  541. that.norm_active = -1
  542. that.close()
  543. }
  544. })
  545. } else {
  546. var url = ''
  547. var data = {
  548. admin_id: that.pageData.admin_id,
  549. admin_name: that.pageData.admin_name,
  550. code: that.pageData.code,
  551. create_at: that.pageData.create_at,
  552. cover: that.pageData.cover,
  553. id: that.pageData.id,
  554. items: that.pageData.items,
  555. name: that.pageData.name,
  556. num_read: that.pageData.num_read,
  557. price_selling: that.pageData.price_selling,
  558. price_market: that.pageData.price_market,
  559. }
  560. if(that.deliveryList.length>0) {
  561. url = '/page_shop/pages/good/submit?pageData=' + JSON.stringify(data) + '&item_id=' + that.norm_active + '&buy_num=' + that.pageData.num + '&address_id=' + that.deliveryList[that.address_active].id
  562. } else {
  563. url = '/page_shop/pages/good/submit?pageData=' + JSON.stringify(data) + '&item_id=' + that.norm_active + '&buy_num=' + that.pageData.num
  564. }
  565. $api.jump(url)
  566. that.close()
  567. /* if(that.deliveryList.length == 0) {
  568. $api.info('请先选择配送地址')
  569. return
  570. }
  571. $api.req({
  572. url: '/data/api.Order/order_create',
  573. method: 'POST',
  574. data: {
  575. admin_id: that.pageData.admin_id,
  576. item_id: that.pageData.items[that.norm_active].id,
  577. num: that.pageData.num,
  578. address_id: that.deliveryList[that.address_active].id
  579. }
  580. }, function(res) {
  581. if(res.code == 1) {
  582. $api.info(res.info)
  583. that.close()
  584. var order_id = res.data.order_id
  585. var pay_no = res.data.pay_no
  586. $api.jump('/page_shop/pages/good/submit?order_id=' + order_id + '&address_id=' + that.deliveryList[that.address_active].id + '&pay_no= ' +pay_no)
  587. }
  588. }) */
  589. }
  590. },
  591. // 关闭弹窗
  592. close() {
  593. that.norm_show = false
  594. that.addr_show = false
  595. that.normType = 0
  596. },
  597. closed() {
  598. that.share_show = false
  599. },
  600. // 选择其他收货地址
  601. select() {
  602. $api.jump('/page_shop/pages/address/list?select=true')
  603. },
  604. // 店铺
  605. toShop() {
  606. $api.jump('/page_shop/pages/good/shop?id=' + that.pageData.admin_id)
  607. },
  608. into_chatroom() {
  609. var my = uni.getStorageSync("myUsername");
  610. var nameList = {
  611. myName: my,
  612. your: that.pageData.huanxinID,
  613. };
  614. uni.navigateTo({
  615. url: "/pages/chatroom/chatroom?username=" + JSON.stringify(nameList),
  616. });
  617. },
  618. // 购物车
  619. toCart() {
  620. $api.jump('/page_shop/pages/mine/cart')
  621. },
  622. onSuccess(e) {
  623. console.log(e);
  624. that.tempImage = e
  625. },
  626. onError(err) {
  627. console.log('发生错误');
  628. console.log(err);
  629. },
  630. saveImg() {
  631. console.log(that.tempImage);
  632. uni.authorize({
  633. scope: 'scope.writePhotosAlbum',
  634. success() {
  635. uni.saveImageToPhotosAlbum({
  636. filePath: that.tempImage,
  637. success: function () {
  638. console.log('save success');
  639. $api.info('保存成功')
  640. that.close()
  641. }
  642. });
  643. }
  644. })
  645. },
  646. },
  647. }
  648. </script>
  649. <style lang="scss" scoped>
  650. .content::v-deep {
  651. background: #F5F5F5;
  652. .nav_item {
  653. font-size: 32rpx;
  654. font-weight: 500;
  655. color: #999999;
  656. line-height: 50rpx;
  657. margin-right: 88rpx;
  658. }
  659. .nav_active {
  660. color: #222222;
  661. position: relative;
  662. }
  663. .nav_active::after {
  664. content: "";
  665. position: absolute;
  666. bottom: -8rpx;
  667. left: 11rpx;
  668. width: 40rpx;
  669. height: 8rpx;
  670. background: #506DFF;
  671. border-radius: 6rpx;
  672. }
  673. .swiper {
  674. width: 690rpx;
  675. margin: 0 auto 10rpx;
  676. .indicator {
  677. @include flex(row);
  678. justify-content: center;
  679. }
  680. .indicator-num {
  681. padding: 4rpx 0;
  682. background-color: rgba(0, 0, 0, 0.6);
  683. border-radius: 20rpx;
  684. width: 72rpx;
  685. @include flex;
  686. justify-content: center;
  687. &__text {
  688. color: #FFFFFF;
  689. font-size: 24rpx;
  690. font-weight: 400;
  691. line-height: 30rpx;
  692. }
  693. }
  694. }
  695. .box {
  696. margin: 10rpx auto;
  697. width: 690rpx;
  698. background: #FFFFFF;
  699. border-radius: 16rpx;
  700. box-sizing: border-box;
  701. padding: 26rpx 20rpx;
  702. .price {
  703. font-size: 32rpx;
  704. font-weight: bold;
  705. color: #FF5959;
  706. line-height: 38rpx;
  707. }
  708. .name {
  709. margin-top: 20rpx;
  710. font-size: 36rpx;
  711. font-weight: 500;
  712. color: #222222;
  713. line-height: 50rpx;
  714. }
  715. .bottom_img {
  716. width: 40rpx;
  717. height: 40rpx;
  718. }
  719. .pad-20 {
  720. padding: 40rpx 0 0;
  721. }
  722. .label {
  723. font-size: 26rpx;
  724. font-weight: 400;
  725. color: #979797;
  726. line-height: 36rpx;
  727. padding-right: 32rpx;
  728. }
  729. .text_style2 {
  730. font-size: 26rpx;
  731. font-weight: 400;
  732. color: #333333;
  733. line-height: 36rpx;
  734. }
  735. }
  736. .box1 {
  737. width: 690rpx;
  738. background: #FFFFFF; border-radius: 16rpx;
  739. margin: 10rpx auto 186rpx;
  740. box-sizing: border-box;
  741. padding: 26rpx 20rpx;
  742. .title {
  743. font-size: 30rpx;
  744. font-weight: 400;
  745. color: #222222;
  746. line-height: 42rpx;
  747. width: 100%;
  748. text-align: center;
  749. padding: 30rpx 0;
  750. }
  751. .cell {
  752. width: 100%;
  753. margin-top: 20rpx;
  754. }
  755. .detail_img {
  756. width: 100%;
  757. padding-bottom: 20rpx;
  758. }
  759. }
  760. .text_style1 {
  761. font-size: 20rpx;
  762. font-weight: 400;
  763. color: #444444;
  764. margin-top: 6rpx;
  765. }
  766. button {
  767. line-height: unset;
  768. }
  769. button::after {
  770. border: none;
  771. }
  772. .bottom {
  773. width: 100%;
  774. // z-index: 9;
  775. position: fixed;
  776. bottom: 0;
  777. height: 166rpx;
  778. background: #FFFFFF;
  779. box-sizing: border-box;
  780. padding: 8rpx 30rpx 74rpx;
  781. .btn1 {
  782. width: 220rpx;
  783. height: 72rpx;
  784. background: #FFCA43;
  785. border-radius: 38rpx 0px 0px 38rpx;
  786. font-size: 28rpx;
  787. font-weight: 500;
  788. color: #FFFFFF;
  789. text-align: center;
  790. line-height: 72rpx;
  791. }
  792. .btn2 {
  793. width: 220rpx;
  794. height: 72rpx;
  795. background: #506DFF;
  796. border-radius: 0px 38rpx 38rpx 0px;
  797. font-size: 28rpx;
  798. font-weight: 500;
  799. color: #FFFFFF;
  800. text-align: center;
  801. line-height: 72rpx;
  802. }
  803. .bottom_img {
  804. width: 40rpx;
  805. height: 40rpx;
  806. }
  807. }
  808. .popu {
  809. background: #FFFFFF;
  810. box-sizing: border-box;
  811. padding: 48rpx 30rpx;
  812. .popu_img {
  813. width: 160rpx;
  814. height: 160rpx;
  815. border-radius: 12rpx;
  816. margin-right: 20rpx;
  817. }
  818. .popu_right {
  819. height: 124rpx;
  820. margin: 20rpx 0 16rpx;
  821. .popu_price {
  822. font-size: 28rpx;
  823. font-weight: 400;
  824. color: #FF4747;
  825. line-height: 34rpx;
  826. }
  827. .popu_norm {
  828. max-width: 450rpx;
  829. font-size: 24rpx;
  830. font-weight: 400;
  831. color: #A7A7A7;
  832. line-height: 34rpx;
  833. }
  834. }
  835. .popu_title {
  836. font-size: 28rpx;
  837. font-weight: 600;
  838. color: #222222;
  839. line-height: 40rpx;
  840. margin: 15rpx 0;
  841. text-overflow: ellipsis;
  842. overflow: hidden;
  843. display: -webkit-box;
  844. -webkit-box-orient: vertical;
  845. box-orient: vertical;
  846. line-clamp: 2;
  847. -webkit-line-clamp: 2;
  848. }
  849. .address {
  850. .address_img {
  851. width: 200rpx;
  852. height: 200rpx;
  853. border-radius: 50%;
  854. margin-bottom: 20rpx;
  855. }
  856. .address_text {
  857. text-align: center;
  858. font-size: 28rpx;
  859. color: #222222;
  860. line-height: 40rpx;
  861. }
  862. }
  863. .box_bg {
  864. background: #F5F5F5;
  865. border-radius: 16rpx;
  866. box-sizing: border-box;
  867. padding: 24rpx 20rpx;
  868. margin: 10rpx 0;
  869. .check_img {
  870. width: 24rpx;
  871. height: 24rpx;
  872. }
  873. .popu_right2 {
  874. padding-left: 30rpx;
  875. .popu_name {
  876. font-size: 28rpx;
  877. font-weight: 500;
  878. color: #222222;
  879. line-height: 40rpx;
  880. }
  881. .popu_phone {
  882. padding-left: 16rpx;
  883. font-size: 22rpx;
  884. font-weight: 400;
  885. color: #999999;
  886. line-height: 16px;
  887. }
  888. .popu_addr {
  889. padding: 16rpx 0 0;
  890. font-size: 24rpx;
  891. font-weight: 400;
  892. color: #444444;
  893. line-height: 34rpx;
  894. }
  895. }
  896. }
  897. .popu_box {
  898. background: #F4F4F4;
  899. border-radius: 8rpx;
  900. font-size: 26rpx;
  901. font-weight: 400;
  902. color: #222222;
  903. line-height: 36rpx;
  904. padding: 7rpx 36rpx;
  905. margin: 0 22rpx 28rpx 0;
  906. text-overflow: ellipsis;
  907. overflow: hidden;
  908. display: -webkit-box;
  909. -webkit-box-orient: vertical;
  910. box-orient: vertical;
  911. line-clamp: 2;
  912. -webkit-line-clamp: 2;
  913. }
  914. .popu_box2 {
  915. background-color: #5b5b5b;
  916. }
  917. // .popu_box:nth-child(4n+4) {
  918. // margin: 0 0 28rpx 0;
  919. // }
  920. .sele_active {
  921. background: #F1F4FF;
  922. border: 1px solid #5471FF;
  923. color: #506DFF;
  924. }
  925. .sure_btn {
  926. width: 100%;
  927. height: 84rpx;
  928. background: #506DFF;
  929. border-radius: 42rpx;
  930. font-size: 36rpx;
  931. font-weight: 500;
  932. color: #FFFFFF;
  933. line-height: 84rpx;
  934. text-align: center;
  935. margin-top: 94rpx;
  936. }
  937. }
  938. .share_content {
  939. position: fixed;
  940. top: 0;
  941. left: 0;
  942. z-index: 99;
  943. width: 100vw;
  944. height: 100vh;
  945. background: rgba(0,0,0,0.5);
  946. backdrop-filter: blur(5px);
  947. padding: 0 0 0;
  948. .cover {
  949. width: 100%;
  950. margin: 0 auto;
  951. height: 520rpx;
  952. // opacity:0
  953. }
  954. .share_price {
  955. font-size: 28rpx;
  956. font-weight: 400;
  957. color: #FF5959;
  958. line-height: 34rpx;
  959. margin: 6rpx 20rpx 12rpx;
  960. }
  961. .share_box {
  962. // margin: 130rpx auto 0;
  963. // width: 650rpx;
  964. // background: #FFFFFF;
  965. // border-radius: 20rpx;
  966. // box-sizing: border-box;
  967. // z-index: -999;
  968. // // opacity: 0;
  969. // padding: 0 40rpx;
  970. margin: 130rpx auto 0;
  971. width: 650rpx;
  972. background: #FFFFFF;
  973. border-radius: 20rpx;
  974. box-sizing: border-box;
  975. padding: 48rpx 35rpx 0;
  976. .share_name {
  977. max-width: 500rpx;
  978. font-size: 30rpx;
  979. font-weight: 400;
  980. color: #222222;
  981. line-height: 42rpx;
  982. margin: 0 20rpx 44rpx;
  983. }
  984. .share_label {
  985. width: 100%;
  986. font-size: 28rpx;
  987. font-weight: 400;
  988. color: #222222;
  989. line-height: 40rpx;
  990. }
  991. .share_text {
  992. width: 100%;
  993. font-size: 24rpx;
  994. font-weight: 400;
  995. color: #999999;
  996. line-height: 34rpx;
  997. text-overflow: ellipsis;
  998. overflow: hidden;
  999. display: -webkit-box;
  1000. -webkit-box-orient: vertical;
  1001. box-orient: vertical;
  1002. line-clamp: 5;
  1003. -webkit-line-clamp: 5;
  1004. }
  1005. .box_bottom {
  1006. width: 100%;
  1007. padding: 34rpx 0 16rpx;
  1008. border-top: 1rpx dashed #C3C3C3;
  1009. .bottom_left1 {
  1010. font-size: 32rpx;
  1011. font-weight: 500;
  1012. color: #222222;
  1013. line-height: 44rpx;
  1014. padding-bottom: 20rpx;
  1015. }
  1016. .bottom_left2 {
  1017. font-size: 22rpx;
  1018. font-weight: 400;
  1019. color: #999999;
  1020. line-height: 32rpx;
  1021. }
  1022. .bottom_right {
  1023. width: 136rpx;
  1024. height: 136rpx;
  1025. }
  1026. }
  1027. }
  1028. /* .canvas2 {
  1029. position: absolute;
  1030. top: 188rpx;
  1031. left: 50rpx;
  1032. width: 650rpx;
  1033. min-height: 494rpx;
  1034. background: #FFFFFF;
  1035. border-radius: 20rpx;
  1036. // z-index: 9;
  1037. } */
  1038. .share_bottom {
  1039. position: fixed;
  1040. bottom: 0;
  1041. width: 100%;
  1042. height: 388rpx;
  1043. background: #F5F7FF;
  1044. border-radius: 40rpx 40rpx 0px 0px;
  1045. z-index: 99;
  1046. .bottom_item {
  1047. width: 33%;
  1048. margin: 50rpx 0 90rpx;
  1049. border: none !important;
  1050. background-color: #F5F7FF !important;
  1051. .item_icon {
  1052. width: 76rpx;
  1053. height: 76rpx;
  1054. }
  1055. .item_text {
  1056. font-size: 26rpx;
  1057. font-weight: 400;
  1058. color: #333333;
  1059. line-height: 36rpx;
  1060. margin-top: 12rpx;
  1061. }
  1062. }
  1063. button::after {
  1064. border: none !important;
  1065. }
  1066. .share_cancel {
  1067. width: 100%;
  1068. text-align: center;
  1069. font-size: 32rpx;
  1070. font-weight: 400;
  1071. color: #333333;
  1072. line-height: 44rpx;
  1073. }
  1074. }
  1075. }
  1076. .share_content1 {
  1077. z-index: -99 !important;
  1078. }
  1079. }
  1080. </style>