index.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911
  1. <template>
  2. <!-- 商品属性规格弹窗 -->
  3. <view>
  4. <view class="product-window"
  5. :class="(attr.cartAttr === true ? 'on' : '') + ' ' + (iSbnt?'join':'') + ' ' + (iScart?'joinCart':'')">
  6. <view class="textpic acea-row row-between-wrapper">
  7. <view class="pictrue" @click="showImg()">
  8. <image :src="attr.productSelect.image"></image>
  9. <view class="icon acea-row row-center-wrapper" v-if="cusPreviewImg">
  10. <view class="iconfont icon-fangda1"></view>
  11. </view>
  12. </view>
  13. <view class="text">
  14. <view class="line1">
  15. {{ type == 'setMeal'?title : attr.productSelect.store_name }}
  16. </view>
  17. <view class="money font-color">
  18. <view class="acea-row row-middle">
  19. <text v-if="type =='points'">
  20. <text v-if="parseFloat(attr.productSelect.integral)"><text
  21. class="num">{{ attr.productSelect.integral }}</text>积分</text>
  22. <text
  23. v-if="parseFloat(attr.productSelect.price) && parseFloat(attr.productSelect.integral)">+</text>
  24. <text v-if="parseFloat(attr.productSelect.price)">¥<text
  25. class="num">{{ attr.productSelect.price }}</text></text>
  26. </text>
  27. <text v-else>¥<text class="num">{{ attr.productSelect.price }}</text></text>
  28. <text class='vip-money'
  29. v-if="is_vip>0 && attr.productSelect.vip_price && storeInfo && storeInfo.price_type == 'member'">¥{{attr.productSelect.vip_price}}</text>
  30. <view class="vipImg"
  31. v-if="is_vip>0 && attr.productSelect.vip_price && storeInfo && storeInfo.price_type == 'member'">
  32. <image src="../../static/images/vip.png"></image>
  33. </view>
  34. <view class="icon"
  35. v-if="is_vip>0 && attr.productSelect.vip_price && storeInfo && storeInfo.price_type == 'level'">
  36. <text class="iconfont icon-dengjitubiao"></text>{{storeInfo.level_name}}</view>
  37. </view>
  38. <text class="stock" v-if='isShow'>库存: {{ attr.productSelect.stock }}</text>
  39. <text class='stock' v-if="limitNum">{{type == 'seckill' ? '限量' : type == 'points'?'剩余':'库存'}}:
  40. {{attr.productSelect.quota}}</text>
  41. <slot name="bottom" :attr="attr"></slot>
  42. </view>
  43. </view>
  44. <view class="iconfont icon-guanbi" @click="closeAttr"></view>
  45. </view>
  46. <view class="rollTop">
  47. <view class="productWinList">
  48. <view class="item" v-for="(item, indexw) in attr.productAttr" :key="indexw">
  49. <view class="title">{{ item.attr_name }}</view>
  50. <view class="listn acea-row row-middle">
  51. <view class="itemn" :class="item.index === itemn.attr ? 'on' : ''"
  52. v-for="(itemn, indexn) in item.attr_value" @click="tapAttr(indexw, indexn)"
  53. :key="indexn">
  54. {{ itemn.attr }}
  55. </view>
  56. </view>
  57. </view>
  58. <view class="item" v-if="isDelivery">
  59. <view class="title">配送方式</view>
  60. <view class="listn acea-row row-middle">
  61. <view class="itemn" v-if="attr.deliveryType.includes('1')" @click="getstoreInfo('1')"
  62. :class="flag==1?'on':isStoreBuy?'on2':''">商城配送</view>
  63. <view class="itemn"
  64. v-if="attr.deliveryType.includes('2') && attr.store_self_mention && selfStoreList.length"
  65. @click="getstoreInfo('2')" :class="flag==2?'on':''">门店自提</view>
  66. <view class="itemn" v-if="attr.deliveryType.includes('3') && storeList.length"
  67. @click="getstoreInfo('3')" :class="flag==3?'on':''">门店配送</view>
  68. </view>
  69. </view>
  70. <view class="address acea-row row-middle" v-if="flag ==1 && isDelivery" @click="openAddress">
  71. <view class="adsInfo">{{addressInfo}}</view>
  72. <view class="iconfont icon-gengduo3"></view>
  73. </view>
  74. <view class="address acea-row row-middle" v-if="flag ==3 && isDelivery" @click="openStore">
  75. <view class="adsInfo">{{deliveryName}}{{deliveryAddress}}{{distance}}</view>
  76. <view class="iconfont icon-gengduo3" v-if="attr.isType != 1"></view>
  77. </view>
  78. <view class="address" v-if="flag ==2 && isDelivery" @click="openStore">
  79. <view>{{deliveryName}}</view>
  80. <view class="info acea-row row-between-wrapper">
  81. <view class="con">{{deliveryAddress}}</view>
  82. <view>{{distance}}<text class="iconfont icon-gengduo3" v-if="attr.isType != 1"></text>
  83. </view>
  84. </view>
  85. </view>
  86. </view>
  87. <view class="cart acea-row row-between-wrapper" v-if="type != 'setMeal' && type !='points'">
  88. <view class="title">数量</view>
  89. <view class="carnum acea-row row-left">
  90. <view class="item reduce acea-row row-center-wrapper"
  91. :class="attr.productSelect.cart_num <= 1 ? 'on' : ''"
  92. v-if="attr.productSelect.cart_num <= 1">
  93. <text class="iconfont icon-shangpinshuliang-jian"></text>
  94. </view>
  95. <view class="item reduce acea-row row-center-wrapper"
  96. :class="attr.productSelect.cart_num <= 1 ? 'on' : ''" @click="CartNumDes" v-else>
  97. <text class="iconfont icon-shangpinshuliang-jian"></text>
  98. </view>
  99. <view class='item num acea-row row-middle'>
  100. <input type="number" v-model="attr.productSelect.cart_num"
  101. data-name="productSelect.cart_num" :always-embed="true" :adjust-position="true"
  102. cursor-spacing="30" @input="bindCode(attr.productSelect.cart_num)"></input>
  103. </view>
  104. <view v-if="iSplus" class="item plus acea-row row-center-wrapper" :class="
  105. attr.productSelect.cart_num >= attr.productSelect.stock
  106. ? 'on'
  107. : ''
  108. " @click="CartNumAdd">
  109. <text class="iconfont icon-shangpinshuliang-jia"></text>
  110. </view>
  111. <view v-else class='item plus'
  112. :class='(attr.productSelect.cart_num >= attr.productSelect.quota) || (attr.productSelect.cart_num >= attr.productSelect.product_stock) || (attr.productSelect.cart_num >= attr.productSelect.num) || (type=="seckill" && attr.productSelect.cart_num >= attr.productSelect.once_num)? "on":""'
  113. @click='CartNumAdd'>+</view>
  114. </view>
  115. </view>
  116. </view>
  117. <view class="joinBnt bg-color"
  118. v-if="iSbnt && attr.productSelect.product_stock>0 &&attr.productSelect.quota>0" @click="goCat">我要参团
  119. </view>
  120. <view class="joinBnt on"
  121. v-else-if="(iSbnt && attr.productSelect.quota<=0)||(iSbnt &&attr.productSelect.product_stock<=0)">已售罄
  122. </view>
  123. <view class="joinBnt bg-color" v-if="iScart && attr.productSelect.stock" @click="goCat">确定</view>
  124. <view class="joinBnt on" v-else-if="iScart && !attr.productSelect.stock">已售罄</view>
  125. </view>
  126. <!-- 选择门店 -->
  127. <view class="product-window" :class="isStore?'store':''">
  128. <view class="storeTitle">选择门店<text class="iconfont icon-guanbi5" @click="closeStore"></text></view>
  129. <view class="storeList">
  130. <view class="item" :class="active == index?'on':''" v-for="(item,index) in storeList" :key="index"
  131. @click="tapStore(index,item)">
  132. <view class="name line1">{{item.name}}</view>
  133. <view class="address acea-row row-between">
  134. <view class="iconfont icon-dingwei2"></view>
  135. <view class="info">{{item.address}}</view>
  136. </view>
  137. <view class="time acea-row row-middle">
  138. <view class="iconfont icon-yingyeshijian2"></view>
  139. <view>营业时间:{{item.day_time}}</view>
  140. </view>
  141. <view class="iconfont icon-xuanzhong6" v-if="active == index"></view>
  142. </view>
  143. </view>
  144. </view>
  145. <!-- <addressWindow ref="addressWindow" :isFooter="isFooter" :pagesUrl="pagesUrl" :fromType="1" :address="address"
  146. @changeClose="changeClose" @OnChangeAddress="OnChangeAddress">
  147. </addressWindow> -->
  148. <view class="mask" @touchmove.prevent :hidden="attr.cartAttr === false" @click="closeAttr"></view>
  149. <view class="mask on" @touchmove.prevent :hidden="isStore === false" @click="closeStore"></view>
  150. </view>
  151. </template>
  152. <script>
  153. import addressWindow from '@/components/addressWindow';
  154. import {
  155. getAddressList
  156. } from '@/api/user.js'
  157. import {
  158. storeListApi
  159. } from '@/api/store.js'
  160. import {
  161. mapGetters,
  162. mapState
  163. } from 'vuex';
  164. export default {
  165. computed: {
  166. ...mapState({
  167. nearbyStore: state => state.app.nearbyStore
  168. }),
  169. ...mapGetters(['isLogin'])
  170. },
  171. components: {
  172. addressWindow
  173. },
  174. props: {
  175. isStoreBuy: {
  176. type: Number,
  177. value: 0
  178. },
  179. productId: {
  180. type: Number | String,
  181. value: 0
  182. },
  183. productType: {
  184. type: Number | String,
  185. value: 0
  186. },
  187. cusPreviewImg: {
  188. type: Number,
  189. value: 0
  190. },
  191. title: {
  192. type: String,
  193. default: ''
  194. },
  195. attr: {
  196. type: Object,
  197. default: () => {}
  198. },
  199. storeInfo: {
  200. type: Object,
  201. default: () => {}
  202. },
  203. limitNum: {
  204. type: Number,
  205. value: 0
  206. },
  207. isShow: {
  208. type: Number,
  209. value: 0
  210. },
  211. iSbnt: {
  212. type: Number,
  213. value: 0
  214. },
  215. iSplus: {
  216. type: Number,
  217. value: 0
  218. },
  219. iScart: {
  220. type: Number,
  221. value: 0
  222. },
  223. is_vip: {
  224. type: Number,
  225. value: 0
  226. },
  227. type: {
  228. type: String,
  229. default: ''
  230. },
  231. isFooter: {
  232. type: Boolean,
  233. default: false
  234. }
  235. },
  236. data() {
  237. return {
  238. flag: 1,
  239. addressInfo: '', // 商城快递
  240. deliveryName: '', // 门店配送
  241. distance: '',
  242. deliveryAddress: '',
  243. address: {
  244. address: false
  245. },
  246. pagesUrl: '',
  247. user_latitude: 0,
  248. user_longitude: 0,
  249. isDelivery: false,
  250. storeList: [],
  251. deliveryStoreList: [],
  252. selfStoreList: [],
  253. active: 0,
  254. isStore: false
  255. }
  256. },
  257. mounted() {
  258. try {
  259. this.user_latitude = uni.getStorageSync('user_latitude');
  260. this.user_longitude = uni.getStorageSync('user_longitude');
  261. } catch (e) {}
  262. },
  263. watch: {
  264. // 'attr.deliveryType': {
  265. // handler(newV) {
  266. // if(newV){
  267. // if(this.active<1){
  268. // if (this.user_latitude && this.user_longitude) {
  269. // this.getList();
  270. // } else {
  271. // this.selfLocation();
  272. // }
  273. // }
  274. // this.flag = newV[0];
  275. // this.$emit('deliveryFun',newV[0]);
  276. // }
  277. // },
  278. // deep: true
  279. // }
  280. 'attr.deliveryType'(newValue, oldValue) {
  281. if (JSON.stringify(newValue) != JSON.stringify(oldValue)) {
  282. if (newValue.length) {
  283. if (this.active < 1) {
  284. this.getList();
  285. // if (this.user_latitude && this.user_longitude) {
  286. // this.getList();
  287. // } else {
  288. // this.selfLocation();
  289. // }
  290. }
  291. let num = 1;
  292. if (newValue[0] == 1 && this.isStoreBuy) {
  293. num = newValue[1];
  294. } else {
  295. num = newValue[0];
  296. }
  297. this.flag = num
  298. this.$emit('deliveryFun', num);
  299. }
  300. }
  301. }
  302. },
  303. methods: {
  304. closeStore() {
  305. this.isStore = false;
  306. },
  307. openStore() {
  308. if (this.attr.isType != 1) {
  309. this.isStore = true;
  310. }
  311. },
  312. // 切换门店
  313. tapStore(index, item) {
  314. this.active = index;
  315. this.deliveryName = item.name;
  316. this.deliveryAddress = item.detailed_address + '\xa0';
  317. this.distance = '距您' + item.range + 'km';
  318. this.isStore = false;
  319. this.$emit('onstoreId', item, this.flag);
  320. },
  321. // 切换地址
  322. OnChangeAddress: function(e, row) {
  323. this.address.address = false;
  324. this.addressInfo = row.province + '省' + '\xa0' + row.city + '\xa0' + row.district + '\xa0' + row
  325. .street + '\xa0' + row.detail
  326. this.$emit('onAddressId', row)
  327. },
  328. // 打开弹窗
  329. openAddress() {
  330. this.$refs.addressWindow.getAddressList();
  331. this.address.address = true;
  332. this.pagesUrl = '/pages/users/user_address/index'
  333. },
  334. goCat: function() {
  335. this.$emit('goCat');
  336. },
  337. // 配送地址
  338. getAddressList() {
  339. getAddressList({
  340. page: 1,
  341. limit: 1
  342. }).then(res => {
  343. let data = res.data[0];
  344. if (res.data.length) {
  345. this.addressInfo = data.province + '省' + '\xa0' + data.city + '\xa0' + data.district +
  346. '\xa0' + data.street + '\xa0' + data.detail
  347. this.$emit('onAddressId', data)
  348. } else {
  349. this.addressInfo = '点击添加地址'
  350. }
  351. })
  352. },
  353. // 关闭地址弹窗;
  354. changeClose: function() {
  355. this.$set(this.address, 'address', false);
  356. },
  357. selfLocation() {
  358. let self = this
  359. // #ifdef H5
  360. if (self.$wechat.isWeixin()) {
  361. self.$wechat.location().then(res => {
  362. this.user_latitude = res.latitude;
  363. this.user_longitude = res.longitude;
  364. uni.setStorageSync('user_latitude', res.latitude);
  365. uni.setStorageSync('user_longitude', res.longitude);
  366. self.getList();
  367. })
  368. } else {
  369. // #endif
  370. uni.getLocation({
  371. type: 'wgs84',
  372. success: (res) => {
  373. try {
  374. this.user_latitude = res.latitude;
  375. this.user_longitude = res.longitude;
  376. uni.setStorageSync('user_latitude', res.latitude);
  377. uni.setStorageSync('user_longitude', res.longitude);
  378. } catch {}
  379. self.getList();
  380. },
  381. fail: (res) => {
  382. console.log(res)
  383. // #ifdef MP
  384. uni.getSetting({
  385. success: res => {
  386. if (typeof(res.authSetting['scope.userLocation']) !=
  387. 'undefined' && !res.authSetting['scope.userLocation']) {
  388. uni.setStorageSync('refuseLocation', true);
  389. }
  390. }
  391. })
  392. // #endif
  393. }
  394. // complete: function() {
  395. // self.getList();
  396. // }
  397. });
  398. // #ifdef H5
  399. }
  400. // #endif
  401. },
  402. getList: function(id) {
  403. let data = {
  404. latitude: this.user_latitude || "", //纬度
  405. longitude: this.user_longitude || "", //经度
  406. page: 1,
  407. limit: 100,
  408. product_id: this.productId,
  409. is_store: '', //查找所有门店列表
  410. type: this.type == 'seckill' ? 1 : 0,
  411. store_id: id ? id : this.nearbyStore
  412. };
  413. storeListApi(data)
  414. .then(res => {
  415. let list = res.data.list.list;
  416. if (!id && list.length && this.attr && ((this.attr.deliveryType.indexOf('2') != -1 && this
  417. .attr.store_self_mention) || this.attr.deliveryType.indexOf('3') != -1)) {
  418. this.isDelivery = true;
  419. if (this.$store.getters.isLogin) {
  420. this.getAddressList()
  421. }
  422. }
  423. // 拆分自提门店列表和配送门店列表
  424. let selfStoreList = [];
  425. list.forEach(function(item, index) {
  426. if (item.is_store === 1) selfStoreList.push(item);
  427. });
  428. this.storeList = this.flag == 2 ? selfStoreList : list;
  429. this.selfStoreList = selfStoreList; //门店自提
  430. this.deliveryStoreList = list; //门店配送
  431. this.active = 0;
  432. this.deliveryName = list[0].name;
  433. this.deliveryAddress = list[0].detailed_address + '\xa0';
  434. this.distance = '距您' + list[0].range + 'km';
  435. this.$emit('onstoreId', list[0], this.flag);
  436. })
  437. .catch(err => {
  438. this.$util.Tips({
  439. title: err
  440. })
  441. });
  442. },
  443. /**
  444. * 购物车手动输入数量
  445. *
  446. */
  447. bindCode: function(e) {
  448. this.$emit('iptCartNum', this.attr.productSelect.cart_num);
  449. },
  450. closeAttr: function() {
  451. this.$emit('myevent');
  452. },
  453. CartNumDes: function() {
  454. this.$emit('ChangeCartNum', false);
  455. },
  456. CartNumAdd: function() {
  457. this.$emit('ChangeCartNum', true);
  458. },
  459. tapAttr: function(indexw, indexn) {
  460. let that = this;
  461. that.$emit("attrVal", {
  462. indexw: indexw,
  463. indexn: indexn
  464. });
  465. this.$set(this.attr.productAttr[indexw], 'index', this.attr.productAttr[indexw].attr_values[indexn]);
  466. let value = that
  467. .getCheckedValue()
  468. .join(",");
  469. that.$emit("ChangeAttr", value);
  470. },
  471. //获取被选中属性;
  472. getCheckedValue: function() {
  473. let productAttr = this.attr.productAttr;
  474. let value = [];
  475. for (let i = 0; i < productAttr.length; i++) {
  476. for (let j = 0; j < productAttr[i].attr_values.length; j++) {
  477. if (productAttr[i].index === productAttr[i].attr_values[j]) {
  478. value.push(productAttr[i].attr_values[j]);
  479. }
  480. }
  481. }
  482. return value;
  483. },
  484. // 选择配送方式
  485. getstoreInfo(index) {
  486. if (index == 1 && this.isStoreBuy) {
  487. return false
  488. }
  489. if (index === '2' || index === '3') {
  490. if ((!this.user_latitude || !this.user_longitude) && !uni.getStorageSync('refuseLocation')) {
  491. this.selfLocation();
  492. }
  493. }
  494. if (index === '2') this.storeList = this.selfStoreList; //门店自提
  495. if (index === '3') this.storeList = this.deliveryStoreList; //门店配送
  496. this.flag = index;
  497. this.active = 0;
  498. this.deliveryName = this.storeList[0].name;
  499. this.deliveryAddress = this.storeList[0].detailed_address + '\xa0';
  500. this.distance = '距您' + this.storeList[0].range + 'km';
  501. this.$emit('deliveryFun', index);
  502. this.$emit('onstoreId', this.storeList[0], index);
  503. },
  504. showLocation() {
  505. if ((!this.user_latitude || !this.user_longitude) && !uni.getStorageSync('refuseLocation')) {
  506. this.selfLocation();
  507. }
  508. },
  509. showImg() {
  510. this.$emit('getImg');
  511. }
  512. }
  513. }
  514. </script>
  515. <style scoped lang="scss">
  516. .mask.on {
  517. z-index: 100 !important;
  518. }
  519. .product-window {
  520. .productWinList {
  521. .address {
  522. width: 690rpx;
  523. background: #F5F5F5;
  524. padding: 30rpx 24rpx;
  525. margin: 0 auto;
  526. margin-top: 20rpx;
  527. font-weight: 400;
  528. color: #333333;
  529. font-size: 26rpx;
  530. border-radius: 10rpx;
  531. .adsInfo {
  532. max-width: 594rpx;
  533. }
  534. .iconfont {
  535. font-size: 18rpx;
  536. margin-left: 12rpx;
  537. }
  538. .info {
  539. font-weight: 400;
  540. color: #999999;
  541. margin-top: 12rpx;
  542. .con {
  543. width: 416rpx;
  544. }
  545. }
  546. }
  547. }
  548. }
  549. .active {
  550. position: relative;
  551. border: 1px solid var(--view-theme);
  552. .icon-xuanzhong6 {
  553. font-size: 46rpx;
  554. position: absolute;
  555. bottom: -4rpx;
  556. right: -6rpx;
  557. color: var(--view-theme);
  558. }
  559. }
  560. .vip-money {
  561. color: #282828;
  562. font-size: 28rpx;
  563. font-weight: 700;
  564. margin-left: 6rpx;
  565. }
  566. .vipImg {
  567. width: 56rpx;
  568. height: 20rpx;
  569. margin-left: 6rpx;
  570. image {
  571. width: 100%;
  572. height: 100%;
  573. display: block;
  574. }
  575. }
  576. .product-window {
  577. &.store {
  578. background-color: #F5F5F5;
  579. border-radius: 20rpx 20rpx 0 0;
  580. transform: translate3d(0, 0, 0);
  581. z-index: 102;
  582. margin: 0;
  583. }
  584. .storeTitle {
  585. text-align: center;
  586. height: 100rpx;
  587. line-height: 100rpx;
  588. font-size: 32rpx;
  589. font-weight: 500;
  590. color: #282828;
  591. position: relative;
  592. .iconfont {
  593. position: absolute;
  594. font-size: 35rpx;
  595. right: 30rpx;
  596. }
  597. }
  598. .storeList {
  599. max-height: 690rpx;
  600. overflow: auto;
  601. .item {
  602. width: 690rpx;
  603. background: #FFFFFF;
  604. border-radius: 12rpx;
  605. margin: 0 auto 20rpx auto;
  606. padding: 28rpx 30rpx;
  607. border: 1px solid #fff;
  608. position: relative;
  609. &.on {
  610. border-color: var(--view-theme);
  611. }
  612. .icon-xuanzhong6 {
  613. position: absolute;
  614. right: -6rpx;
  615. bottom: -6rpx;
  616. color: var(--view-theme);
  617. font-size: 54rpx;
  618. }
  619. .name {
  620. font-weight: 500;
  621. color: #333333;
  622. font-size: 28rpx;
  623. }
  624. .time {
  625. font-weight: 400;
  626. color: #888888;
  627. font-size: 22rpx;
  628. margin-top: 15rpx;
  629. .iconfont {
  630. font-size: 20rpx;
  631. margin-right: 8rpx;
  632. }
  633. }
  634. .address {
  635. font-weight: 400;
  636. color: #888888;
  637. font-size: 22rpx;
  638. margin-top: 13rpx;
  639. .iconfont {
  640. font-size: 20rpx;
  641. margin-right: 8rpx;
  642. margin-top: 6rpx;
  643. }
  644. .info {
  645. width: 590rpx;
  646. line-height: 1.5;
  647. }
  648. }
  649. }
  650. }
  651. }
  652. .product-window {
  653. position: fixed;
  654. bottom: 0;
  655. width: 100%;
  656. left: 0;
  657. background-color: #fff;
  658. z-index: 100;
  659. border-radius: 16rpx 16rpx 0 0;
  660. transform: translate3d(0, 100%, 0);
  661. transition: all .3s cubic-bezier(.25, .5, .5, .9);
  662. padding-bottom: 140rpx;
  663. padding-bottom: calc(140rpx+ constant(safe-area-inset-bottom)); ///兼容 IOS<11.2/
  664. padding-bottom: calc(140rpx + env(safe-area-inset-bottom)); ///兼容 IOS>11.2/
  665. }
  666. .product-window.on {
  667. transform: translate3d(0, 0, 0);
  668. }
  669. .product-window.join {
  670. padding-bottom: 30rpx;
  671. }
  672. .product-window.joinCart {
  673. padding-bottom: 30rpx;
  674. z-index: 10000;
  675. }
  676. .product-window .textpic {
  677. padding: 0 130rpx 0 30rpx;
  678. margin-top: 29rpx;
  679. position: relative;
  680. }
  681. .product-window .textpic .pictrue {
  682. width: 150rpx;
  683. height: 150rpx;
  684. position: relative;
  685. .icon {
  686. width: 30rpx;
  687. height: 30rpx;
  688. background-color: rgba(0, 0, 0, 0.4);
  689. border-radius: 4rpx;
  690. position: absolute;
  691. bottom: 8rpx;
  692. right: 8rpx;
  693. text-align: center;
  694. line-height: 23rpx;
  695. .iconfont {
  696. color: #fff;
  697. font-size: 20rpx;
  698. }
  699. }
  700. }
  701. .product-window .textpic .pictrue image {
  702. width: 100%;
  703. height: 100%;
  704. border-radius: 10rpx;
  705. }
  706. .product-window .textpic .text {
  707. width: 410rpx;
  708. font-size: 32rpx;
  709. color: #202020;
  710. }
  711. .product-window .textpic .text .money {
  712. font-size: 24rpx;
  713. margin-top: 40rpx;
  714. .icon {
  715. display: inline-block;
  716. font-size: 16rpx;
  717. font-weight: normal;
  718. background: #FF9500;
  719. color: #fff;
  720. border-radius: 18rpx;
  721. padding: 2rpx 6rpx;
  722. margin-left: 10rpx;
  723. .iconfont {
  724. font-size: 16rpx;
  725. margin-right: 4rpx;
  726. color: #fff;
  727. }
  728. }
  729. }
  730. .product-window .textpic .text .money .num {
  731. font-size: 36rpx;
  732. }
  733. .product-window .textpic .text .money .stock {
  734. color: #999;
  735. margin-left: 6rpx;
  736. }
  737. .product-window .textpic .icon-guanbi {
  738. position: absolute;
  739. right: 30rpx;
  740. top: -5rpx;
  741. font-size: 35rpx;
  742. color: #8a8a8a;
  743. }
  744. .product-window .rollTop {
  745. max-height: 535rpx;
  746. overflow: auto;
  747. margin-top: 36rpx;
  748. }
  749. .product-window .productWinList .item~.item {
  750. margin-top: 36rpx;
  751. }
  752. .product-window .productWinList .item .title {
  753. font-size: 30rpx;
  754. color: #999;
  755. padding: 0 30rpx;
  756. }
  757. .product-window .productWinList .item .listn {
  758. padding: 0 30rpx 0 16rpx;
  759. }
  760. .product-window .productWinList .item .listn .itemn {
  761. border: 1px solid #F2F2F2;
  762. font-size: 26rpx;
  763. color: #282828;
  764. padding: 7rpx 33rpx;
  765. border-radius: 25rpx;
  766. margin: 20rpx 0 0 14rpx;
  767. background-color: #F2F2F2;
  768. word-break: break-all;
  769. }
  770. .product-window .productWinList .item .listn .itemn.on {
  771. color: var(--view-theme);
  772. background: var(--view-minorColorT);
  773. border-color: var(--view-theme);
  774. }
  775. .product-window .productWinList .item .listn .itemn.on2 {
  776. background: #bbb;
  777. color: #fff;
  778. border-color: #bbb;
  779. }
  780. .product-window .productWinList .item .listn .itemn.limit {
  781. color: #999;
  782. text-decoration: line-through;
  783. }
  784. .product-window .cart {
  785. margin-top: 36rpx;
  786. padding: 0 30rpx;
  787. }
  788. .product-window .cart .title {
  789. font-size: 30rpx;
  790. color: #999;
  791. }
  792. .product-window .cart .carnum {
  793. height: 54rpx;
  794. margin-top: 24rpx;
  795. }
  796. .product-window .cart .carnum .iconfont {
  797. font-size: 25rpx;
  798. }
  799. .product-window .cart .carnum view {
  800. // border: 1px solid #a4a4a4;
  801. width: 84rpx;
  802. text-align: center;
  803. height: 100%;
  804. line-height: 54rpx;
  805. color: #282828;
  806. font-size: 45rpx;
  807. }
  808. .product-window .cart .carnum .reduce {
  809. border-right: 0;
  810. border-radius: 6rpx 0 0 6rpx;
  811. line-height: 48rpx;
  812. font-size: 60rpx;
  813. }
  814. .product-window .cart .carnum .reduce.on {
  815. color: #DEDEDE;
  816. }
  817. .product-window .cart .carnum .plus {
  818. border-left: 0;
  819. border-radius: 0 6rpx 6rpx 0;
  820. line-height: 46rpx;
  821. }
  822. .product-window .cart .carnum .plus.on {
  823. // border-color: #e3e3e3;
  824. color: #dedede;
  825. }
  826. .product-window .cart .carnum .num {
  827. background: rgba(242, 242, 242, 1);
  828. color: #282828;
  829. font-size: 28rpx;
  830. }
  831. .product-window .joinBnt {
  832. font-size: 30rpx;
  833. width: 620rpx;
  834. height: 86rpx;
  835. border-radius: 50rpx;
  836. text-align: center;
  837. line-height: 86rpx;
  838. color: #fff;
  839. margin: 21rpx auto 0 auto;
  840. }
  841. .product-window .joinBnt.on {
  842. background-color: #bbb;
  843. color: #fff;
  844. }
  845. </style>