createOrderKlon.vue 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473
  1. <template>
  2. <view>
  3. <!-- 地址 -->
  4. <uni-notice-bar class="notice-bar" background-color="#FFFFFF" color="#141414" showIcon="true" single="true" :text="notice"></uni-notice-bar>
  5. <view v-if="tabCurrentIndex == 0" class="address-section">
  6. <view class="order-content" v-if="addressData.real_name">
  7. <text class="iconfont iconlocation"></text>
  8. <view class="cen">
  9. <view class="top">
  10. <text class="name">{{ addressData.real_name }}</text>
  11. <text class="mobile">{{ addressData.phone }}</text>
  12. </view>
  13. <text class="address">{{ addressData.province + addressData.city + addressData.district }} {{ addressData.detail }}</text>
  14. </view>
  15. <text class="iconfont iconenter"></text>
  16. </view>
  17. <view class="order-content" v-if="!addressData.real_name" @click="navTo('/pages/address/addressPink')">
  18. <view class="addAddress">
  19. <text class="iconfont iconaddition"></text>
  20. <text>添加拼团地址</text>
  21. </view>
  22. </view>
  23. <image class="a-bg" :src="addressImg"></image>
  24. </view>
  25. <!-- <navigator v-if="tabCurrentIndex == 1" url="/pages/address/shopList" class="address-section">
  26. <view class="order-content" v-if="shopAddress.name">
  27. <text class="iconfont iconlocation"></text>
  28. <view class="cen">
  29. <view class="top">
  30. <text class="name">{{ shopAddress.name }}</text>
  31. <text class="mobile">{{ shopAddress.mobile }}</text>
  32. </view>
  33. <text class="address">{{ shopAddress.address }} {{ shopAddress.area }}</text>
  34. </view>
  35. <text class="iconfont iconenter"></text>
  36. </view>
  37. <view class="order-content" v-if="!shopAddress.name">
  38. <text class="addAddress">
  39. <text class="iconfont iconaddition"></text>
  40. <text>添加收货地址</text>
  41. </text>
  42. </view>
  43. <image class="a-bg" :src="addressImg"></image>
  44. </navigator> -->
  45. <!-- 商品列表 -->
  46. <view class="goods">
  47. <view class="goods-name flex">
  48. <view class="name">送达时间</view>
  49. <!-- <view class="time flex" v-if="showMask">
  50. <view>
  51. <view @tap="showPicker('linkage')" class="result">{{ resulttime }}</view>
  52. <w-picker
  53. mode="linkage"
  54. :value="defaultRegion1"
  55. :options="options"
  56. :level="2"
  57. default-type="id"
  58. :default-props="defaultProps1"
  59. @confirm="onConfirm($event, 'linkage')"
  60. @cancel="onCancel"
  61. ref="linkage"
  62. ></w-picker>
  63. </view>
  64. <text class="iconfont iconenter"></text>
  65. </view> -->
  66. <view class="red">{{mark}}</view>
  67. </view>
  68. <view class="goods-section">
  69. <view class="pink_name" v-if="pink_type == 1">{{pink_name}}</view>
  70. <view class="g-item flex_item" v-if="ShowType == 2">
  71. <scroll-view class="scroll-list" scroll-x>
  72. <view class="scoll-box" v-for="(ls, ind) in shopList" :key="ls.id">
  73. <view class="scoll-img"><image :src="ls.productInfo.image"></image></view>
  74. </view>
  75. </scroll-view>
  76. <view class="total">共{{ shopList.length }}件</view>
  77. </view>
  78. <view class="gift-item flex_item" v-if="ShowType == 1" v-for="(ls, ind) in shopList" :key="ind">
  79. <image :src="ls.productInfo.image"></image>
  80. <view class="right">
  81. <text class="title clamp">{{ ls.productInfo.store_name }}</text>
  82. <!-- <text class="spec">{{ ls.productInfo.attrInfo ? ls.productInfo.attrInfo.suk : '默认' }}</text> -->
  83. <view class="price-box">
  84. <text class="price">¥{{ ls.productInfo.attrInfo ? ls.productInfo.attrInfo.price : ls.productInfo.price }}</text>
  85. </view>
  86. <view class="price-box">
  87. <text class="number">{{ 'x ' + ls.cart_num }}</text>
  88. </view>
  89. </view>
  90. </view>
  91. </view>
  92. </view>
  93. <!-- 金额明细 -->
  94. <!-- <view class="yt-list">
  95. <view class="yt-list-cell b-b">
  96. <text class="cell-tit clamp">支付方式</text>
  97. <text class="cell-tip">微信</text>
  98. </view>
  99. </view> -->
  100. <view class="goods" v-if="activityPro">
  101. <view class="goods-section">
  102. <view class="gift-item flex_item padding-t-0">
  103. <image :src="activityPro.image"></image>
  104. <view class="right">
  105. <text class="title clamp">{{ activityPro.store_name }}</text>
  106. <!-- <text class="spec">{{ activityPro.attrInfo ? activityPro.attrInfo.suk : '默认' }}</text> -->
  107. <view class="price-box"><text class="price">免费</text></view>
  108. </view>
  109. <view class="iconLeftTip">活动赠品</view>
  110. </view>
  111. </view>
  112. </view>
  113. <!-- <view class="green_card">
  114. <view class="box">
  115. <view class="img"><image src="/static/img/img36.png"></image></view>
  116. <view class="list flex">
  117. <view class="tpl">
  118. <view class="tip" v-if="grade < 100">
  119. 开通美卡,本单最高可减
  120. <text>{{ moneyAll.vipPrice }}元</text>
  121. </view>
  122. <view class="tip" v-if="grade > 99">
  123. 您已开通美卡,本单节省
  124. <text>{{ moneyAll.vipPrice }}元</text>
  125. </view>
  126. <view class="top" v-if="grade < 100">一天2毛4,一年约省806元</view>
  127. <view class="top" v-if="grade > 99">美卡有效期至{{ userInfo.level_valid_time }}</view>
  128. </view>
  129. <view class="tpl flex" v-if="grade < 100">
  130. <view class="money">¥88.00/年</view>
  131. <radio @click="checkbox" color="#06B163" :checked="checked" />
  132. </view>
  133. <view class="member" v-if="grade > 99" @click="ToMemer">
  134. 我的美卡
  135. <text class="iconfont iconenter"></text>
  136. </view>
  137. </view>
  138. </view>
  139. </view> -->
  140. <view class="info">
  141. <view class="flex">
  142. <view>商品金额</view>
  143. <view>¥{{ priceGroupDate.total_price }}</view>
  144. </view>
  145. <view class="flex">
  146. <view>配送费用</view>
  147. <view>¥{{ priceGroupDate.pay_postage }}</view>
  148. </view>
  149. <!-- <view class="flex" v-if="showMask"><view style="color: #ff383e;font-size: 24rpx;">(第一笔订单满19元时,第二单选择相同时段配送免配送费)</view></view> -->
  150. <view class="flex" v-if="!DeliveryChecked.coupon_price"></view>
  151. <view class="flex" v-if="DeliveryChecked.coupon_price">
  152. <view>配送券</view>
  153. <view class="red">-¥{{ DeliveryChecked.coupon_price }}</view>
  154. </view>
  155. </view>
  156. <!-- 底部 -->
  157. <view class="footer">
  158. <view class="price-content">
  159. <text>实付款:</text>
  160. <text class="price-tip">¥</text>
  161. <text class="price">{{ payPrice }}</text>
  162. </view>
  163. <text class="submit" :class="{ submitNo: !payType }" @click="payType ? submit() : ''">提交订单</text>
  164. </view>
  165. <!-- 优惠券面板 -->
  166. <view class="mask" :class="maskState === 0 ? 'none' : maskState === 1 ? 'show' : ''" @click="toggleMask">
  167. <view class="mask-content">
  168. <!-- 优惠券页面,仿mt -->
  169. <view class="name">领优惠券</view>
  170. <view class="coupon-item flex" @click="checkedCp(item)" v-for="(item, index) in couponList" :key="index">
  171. <view class="left">
  172. <view class="left-price">
  173. <text>{{ item.coupon_price }}</text>
  174. </view>
  175. <view class="left-man">满{{ item.use_min_price }}元使用</view>
  176. </view>
  177. <view class="right flex">
  178. <view class="right-info">
  179. <view class="info-name">{{ item.coupon_title }}</view>
  180. <view class="info-tip">限指定商品使用</view>
  181. <view class="info-tip">有效期至{{ item.end_time }}</view>
  182. </view>
  183. <!-- <view class="right-submit">立即领取</view> -->
  184. </view>
  185. </view>
  186. </view>
  187. </view>
  188. <!-- 领取商品券 -->
  189. <view class="mask" :class="goodsState === 0 ? 'none' : goodsState === 1 ? 'show' : ''" @click="goods">
  190. <view class="mask-content">
  191. <!-- 优惠券页面,仿mt -->
  192. <view class="name">领商品券</view>
  193. <view v-for="(item, index) in goodsList" :key="index" @click="checkedGoods(item)" class="goodsState flex">
  194. <view class="img"><image src="/static/img/img37.png" mode="scaleToFill"></image></view>
  195. <view class="delivery-box flex">
  196. <view class="list-money">
  197. <view class="tit">
  198. <text>{{ item.coupon_price }}</text>
  199. </view>
  200. <view class="price">美天选菜商品券</view>
  201. </view>
  202. <view class="row_list_right">
  203. <view class="title">{{ item.coupon_title }}</view>
  204. <view class="text">使用日期:{{ item.add_time }} 至{{ item.end_time }}</view>
  205. </view>
  206. <view class="use"><text>使用</text></view>
  207. </view>
  208. <view class="img"><image src="/static/img/img38.png" mode="scaleToFill"></image></view>
  209. </view>
  210. </view>
  211. </view>
  212. <view class="check_box flex" v-if="pink_type == 1">
  213. <view class="ziti-text" @click="Ziti">《用户自提协议》</view>
  214. <view><radio style="transform: scale(0.75)" @click="Getcheckbox11" color="#3DCF35" :checked="checked11" />同意</view>
  215. </view>
  216. <!-- 是否需要食物商品 -->
  217. <!-- <uni-popup ref="popup" type="center" :maskClick="false">
  218. <view class="pop-box">
  219. <view class="pop-tit">是否需要实物商品</view>
  220. <view class="pop-buttom">
  221. <view class="pop-sub" style="color: #5dbc7c;" @click="Needyes">是</view>
  222. <view class="pop-sub" style="color: #FF0000;" @click="Needno">否</view>
  223. </view>
  224. </view>
  225. </uni-popup> -->
  226. </view>
  227. </template>
  228. <script>
  229. import { mapState, mapMutations } from 'vuex';
  230. import { confirm } from '@/api/order.js';
  231. import { couponsOrder } from '@/api/coupon.js';
  232. import { computedOrderkey } from '@/api/money.js';
  233. import { pinkAddress } from '@/api/address.js';
  234. import { cartAdd } from '@/api/product.js';
  235. import uniPopup from '@/components/uni-popup/uni-popup.vue';
  236. import wPicker from '@/components/w-picker/w-picker.vue';
  237. export default {
  238. components: {
  239. wPicker,
  240. uniPopup
  241. },
  242. data() {
  243. return {
  244. pink_type:"",//区分拼团订单和普通订单
  245. pink_name:"",//区分aa团和达人团
  246. checked11:false,
  247. mark:"",
  248. ShowType: 1, //商品显示形式
  249. checkedPei: false, //是否选择配送券
  250. checked: false, //是否选择开通美卡
  251. isBuyVip: 0, //0为未使用配送券,1为使用配送券
  252. Deliveryid: 0, //选择的配送券id
  253. userInfo: '', //用户个人信息
  254. estimated_time: '', //选择配送时间
  255. resulttime: '请选择送达时间', //选择配送时间传值
  256. defaultProps1: {
  257. label: 'name',
  258. value: 'id',
  259. children: 'child'
  260. },
  261. defaultRegion1: ['1', '9'],
  262. options: [
  263. {
  264. id: '1',
  265. name: '明日到家',
  266. child: [
  267. {
  268. id: '9',
  269. name: '请选择送达时间',
  270. child: []
  271. },
  272. {
  273. id: '11',
  274. name: '预计16:30前',
  275. child: []
  276. },
  277. {
  278. id: '10',
  279. name: '预计10:30前',
  280. child: []
  281. }
  282. ]
  283. }
  284. ],
  285. addressImg: '/static/img/img35.png',
  286. // 当前选中的支付方式
  287. tabCurrentIndex: 0,
  288. notice: '商品到货后,系统将会通知您来取货~',
  289. navList: [
  290. {
  291. state: 0,
  292. text: '快递配送'
  293. },
  294. {
  295. state: 1,
  296. text: '到店自提'
  297. }
  298. ],
  299. showMask: true, //是否显示优惠券面板
  300. maskState: 0, //优惠券面板显示状态
  301. goodsState: 0, //商品券面板显示状态
  302. deliveryState: 0, //配送权面板显示状态
  303. desc: '', //备注
  304. couponList: [], // 优惠券列表
  305. deliveryList: [], //配送券列表
  306. goodsList: [], //商品券列表
  307. couponChecked: '', //选中的优惠券
  308. DeliveryChecked: '', //选中的配送券
  309. GoodsChecked: '', //选中的商品券
  310. // 收货地址
  311. addressData: {},
  312. // 店铺地址
  313. shopAddress: {
  314. name: '',
  315. mobile: '',
  316. addressName: '',
  317. address: '',
  318. area: '',
  319. default: false
  320. },
  321. // 商品列表
  322. shopList: [],
  323. // 购物车id
  324. cartId: '',
  325. grade: '', //用户等级
  326. //购物金额详情
  327. moneyAll: {
  328. storeFreePostage: 0, //邮费优惠
  329. storePostage: 0, //邮费
  330. totalPrice: 0, //总支付金额
  331. vipPrice: 0 //vip优惠价
  332. },
  333. payPrice: 0, //总支付金额
  334. orderKey: '', //订单id
  335. checkedPoints: false, //判断是否积分抵扣
  336. integralShow: false, //是否显示积分抵扣金额
  337. payType: 1, //1微信 2支付宝
  338. // payType: true, //是否可支付
  339. pinkid: '', //保存拼团商品id
  340. form: '', //0优惠券,3配送券,2商品券
  341. priceGroupDate: '', //重新计算金额
  342. activityPro: '' ,//活动赠送商品
  343. goodsType: '', // 是否为拼团
  344. neednum: '', // 是否需要食物
  345. pinkUser: '' ,//是否为团长
  346. klonId: '', // 接龙id
  347. };
  348. },
  349. onLoad(option) {
  350. console.log(option,968)
  351. // 判断是否为拼团商品
  352. if (option.type == 'pink') {
  353. this.showMask = false;
  354. this.pinkid = option.pinkid;
  355. this.cartAdd(option);
  356. } else {
  357. // 判断是否拼团商品过来的
  358. if (+option.goodsType == 2) {
  359. this.showMask = false;
  360. }
  361. // 保存当前商品在购物车中的id
  362. this.cartId = option.id;
  363. this.pinkUser = option.pinkUser
  364. pinkAddress({}).then(({data}) => {
  365. this.addressData = data;
  366. })
  367. this.loadData();
  368. }
  369. },
  370. onShow() {
  371. // 获取拼团地址
  372. pinkAddress({}).then(({data}) => {
  373. this.addressData = data;
  374. })
  375. },
  376. watch: {
  377. checkedPoints(newValue, oldValue) {
  378. this.integralShow = false;
  379. this.payMoneyNub();
  380. },
  381. estimated_time(newValue, oldValue) {
  382. this.payMoneyNub();
  383. }
  384. },
  385. computed: {
  386. Postage() {
  387. let money = +this.moneyAll.storePostage;
  388. if (money == 0) {
  389. return '免运费';
  390. } else {
  391. return '¥' + money;
  392. }
  393. },
  394. payAllMoney() {
  395. return +this.moneyAll.totalPrice + +this.moneyAll.vipPrice;
  396. }
  397. },
  398. methods: {
  399. ...mapMutations(['upAddressPageShow']),
  400. // 选择是
  401. Needyes(){
  402. this.neednum = 0;
  403. this.payMoneyNub()
  404. this.$refs.popup.close()
  405. console.log(this.neednum,99)
  406. },
  407. //自提服务协议
  408. Getcheckbox11() {
  409. let obj = this;
  410. obj.checked11 = !obj.checked11;
  411. },
  412. // 跳转到自提协议
  413. Ziti() {
  414. uni.navigateTo({
  415. url: '/pages/rule/Pickrule'
  416. });
  417. },
  418. // 选择否
  419. Needno(){
  420. this.neednum = 1;
  421. this.payMoneyNub()
  422. this.$refs.popup.close()
  423. console.log(this.neednum,99)
  424. },
  425. showPicker(type) {
  426. this.$refs[type].show();
  427. },
  428. onConfirm(res, type) {
  429. this.resulttime = res.result;
  430. if (res.value[1] == 10) {
  431. this.estimated_time = '10:30';
  432. }
  433. if (res.value[1] == 11) {
  434. this.estimated_time = '16:30';
  435. }
  436. if (res.value[1] == 9) {
  437. this.estimated_time = '';
  438. }
  439. },
  440. onCancel() {},
  441. navTo(url) {
  442. uni.navigateTo({
  443. url
  444. });
  445. },
  446. // 添加商品到购物车
  447. cartAdd(opt) {
  448. let obj = this;
  449. cartAdd({
  450. cartNum: 1, //商品数量
  451. new: 1, //商品是否新增加到购物车1为不加入0为加入
  452. mer_id: +opt.merid, //商店id
  453. combinationId: +opt.gid, //拼团商品id
  454. productId: +opt.pid //普通商品id
  455. })
  456. .then(function(e) {
  457. let da = e.data;
  458. // 獲取购物车号
  459. obj.cartId = da.cartId;
  460. // 加载数据
  461. obj.loadData();
  462. })
  463. .catch(e => {
  464. console.log(e);
  465. });
  466. },
  467. //是否选择配送券
  468. Getcheckbox() {
  469. let obj = this;
  470. obj.checkedPei = !obj.checkedPei;
  471. if (obj.checkedPei == false) {
  472. obj.Deliveryid = 0;
  473. obj.payMoneyNub();
  474. } else {
  475. obj.Deliveryid = obj.deliveryList[0].id;
  476. obj.payMoneyNub();
  477. }
  478. },
  479. Toaddress() {
  480. let addressPageShow = uni.getStorageSync('addaddressPageShowressData');
  481. if (!addressPageShow) {
  482. this.upAddressPageShow();
  483. }
  484. uni.showModal({
  485. title: '提示',
  486. content: '修改地址需要重新下单,是否确认修改?',
  487. success: function(res) {
  488. if (res.confirm) {
  489. uni.navigateTo({
  490. url: '/pages/index/address'
  491. });
  492. } else if (res.cancel) {
  493. }
  494. }
  495. });
  496. },
  497. //是否开通美卡
  498. checkbox() {
  499. let obj = this;
  500. obj.checked = !obj.checked;
  501. console.log(obj.checked, 'checked');
  502. if (obj.checked == false) {
  503. obj.isBuyVip = 0;
  504. obj.payMoneyNub();
  505. } else {
  506. obj.isBuyVip = 1;
  507. obj.payMoneyNub();
  508. }
  509. },
  510. // 计算支付金额
  511. payMoneyNub() {
  512. console.log(this.neednum)
  513. computedOrderkey({
  514. isBuyVip: this.isBuyVip, //是否使用配送券
  515. orderkey: this.orderKey,
  516. useIntegral: this.checkedPoints ? 1 : 0, //是否积分抵扣
  517. couponId: this.couponChecked.id, //优惠券编号
  518. goCouponId: this.Deliveryid, //配送券编号
  519. productCouponId: this.GoodsChecked.id, //商品券编号
  520. addressId: this.addressData.id, //地址编号
  521. estimated_time: this.estimated_time,
  522. is_pink_free: this.neednum,
  523. isPink: 0,
  524. jl_id: this.klonId,
  525. })
  526. .then(({ data }) => {
  527. this.payType = true;
  528. this.integralShow = true;
  529. // 获取支付金额
  530. this.payPrice = +data.result.pay_price;
  531. this.priceGroupDate = data.result;
  532. // 保存活动赠送商品
  533. this.activityPro = data.result.activityPro;
  534. })
  535. .catch(e => {
  536. console.log(e);
  537. this.integralShow = false;
  538. this.payType = false;
  539. });
  540. },
  541. // 是否使用积分
  542. checkedIntegral() {
  543. this.checkedPoints = !this.checkedPoints;
  544. },
  545. // 选中优惠券
  546. checkedCp(item) {
  547. this.couponChecked = item;
  548. this.payMoneyNub();
  549. },
  550. // 选中配送券
  551. // checkedDelivery(item) {
  552. // this.DeliveryChecked = item;
  553. // this.payMoneyNub();
  554. // },
  555. // 选中商品券
  556. checkedGoods(item) {
  557. this.GoodsChecked = item;
  558. this.payMoneyNub();
  559. },
  560. //顶部tab点击
  561. tabClick(index) {
  562. this.tabCurrentIndex = index;
  563. },
  564. // maskState: 0, //优惠券面板显示状态
  565. // goodsState:0,//商品券面板显示状态
  566. // deliveryState:0,//配送券面板显示状态
  567. //显示优惠券面板
  568. toggleMask(type) {
  569. if (this.userInfo.discount_coupon_count == 0) {
  570. return;
  571. } else {
  572. let timer = type === 'show' ? 10 : 300;
  573. let state = type === 'show' ? 1 : 0;
  574. this.maskState = 2;
  575. setTimeout(() => {
  576. this.maskState = state;
  577. }, timer);
  578. }
  579. },
  580. //显示商品券面板
  581. goods(type) {
  582. if (this.userInfo.product_coupon_count == 0) {
  583. return;
  584. }
  585. let timer = type === 'show' ? 10 : 300;
  586. let state = type === 'show' ? 1 : 0;
  587. this.goodsState = 2;
  588. setTimeout(() => {
  589. this.goodsState = state;
  590. }, timer);
  591. },
  592. //显示配送券面板
  593. delivery(type) {
  594. if (this.userInfo.freight_coupon_count == 0) {
  595. return;
  596. }
  597. let timer = type === 'show' ? 10 : 300;
  598. let state = type === 'show' ? 1 : 0;
  599. this.deliveryState = 2;
  600. setTimeout(() => {
  601. this.deliveryState = state;
  602. }, timer);
  603. },
  604. // 加载优惠券列表
  605. // couponsOrder() {
  606. // let obj = this;
  607. // let money = obj.moneyAll.totalPrice;
  608. // couponsOrder(
  609. // {
  610. // form: 0
  611. // },
  612. // money
  613. // ).then(e => {
  614. // this.couponList = e.data;
  615. // });
  616. // couponsOrder(
  617. // {
  618. // form: 2
  619. // },
  620. // money
  621. // ).then(e => {
  622. // this.goodsList = e.data;
  623. // });
  624. // couponsOrder(
  625. // {
  626. // form: 3
  627. // },
  628. // money
  629. // ).then(e => {
  630. // this.deliveryList = e.data;
  631. // });
  632. // },
  633. //获取订单信息
  634. loadData() {
  635. let obj = this;
  636. confirm({ cartId: obj.cartId + '' })
  637. .then(({ data }) => {
  638. obj.mark = data.mark;
  639. obj.klonId = data.jl_id;
  640. // obj.addressData = data.addressInfo || {};
  641. obj.shopList = data.cartInfo; //商品列表
  642. if (obj.shopList.length < 2) {
  643. obj.ShowType = 1;
  644. } else {
  645. obj.ShowType = 2;
  646. }
  647. obj.moneyAll = data.priceGroup; //金额数据
  648. obj.orderKey = data.orderKey; //订单key
  649. obj.userInfo = data.userInfo;
  650. if(data.combination_id){
  651. if(data.combination_id > 0){
  652. obj. pink_type= 1;
  653. obj. pink_name= data.pink_type ;
  654. }else{
  655. obj. pink_type= 0;
  656. }
  657. }
  658. console.log(data.pink_type,55)
  659. if (data.userInfo.level_info == null) {
  660. obj.grade = 0;
  661. } else {
  662. obj.grade = data.userInfo.level_info.grade;
  663. }
  664. // 计算金额
  665. this.payMoneyNub();
  666. // 加载各种券
  667. obj.couponsOrder();
  668. // if( this.pinkid == '' && this.userInfo.day_give == 1 && this.pinkUser == 1) {
  669. // this.$refs.popup.open()
  670. // }
  671. })
  672. .catch(e => {
  673. console.log(e.message);
  674. if (e.message == '未在营业时间') {
  675. setTimeout(function() {
  676. uni.switchTab({
  677. url: '/pages/index/index'
  678. });
  679. }, 1000);
  680. }
  681. });
  682. },
  683. // 购买数量变化
  684. numberChange(data) {
  685. this.number = data.number;
  686. },
  687. // 修改支付方式
  688. changePayType(type) {
  689. this.payType = type;
  690. },
  691. // 提交订单
  692. submit() {
  693. if(this.pink_type == 1){
  694. if(this.checked11 === false){
  695. this.$api.msg('请同意用户自提协议');
  696. return false;
  697. }
  698. }
  699. if (this.checkedPoints && this.shopList.length > 1) {
  700. this.$api.msg('积分商品只可单件购买');
  701. return false;
  702. }
  703. if (!this.addressData.real_name) {
  704. this.$api.msg('请选择收货地址');
  705. return false;
  706. }
  707. // if (this.estimated_time == '' && this.showMask) {
  708. // this.$api.msg('请选择送达时间');
  709. // return false;
  710. // }
  711. let url = '/pages/money/pay?key=' + this.orderKey + '&estimated_time=' + this.estimated_time + '&free=' + this.neednum + '&pinkUser=' + this.pinkUser + '&klonId=' + this.klonId;
  712. if (this.pinkid) {
  713. url += '&pinkid=' + this.pinkid;
  714. }
  715. // 判断是否为拼团商品
  716. if (!this.showMask) {
  717. url += '&pink=1';
  718. }
  719. uni.navigateTo({
  720. url
  721. });
  722. },
  723. ToMemer() {
  724. if (this.grade > 99) {
  725. uni.navigateTo({
  726. url: '/pages/user/renew'
  727. });
  728. }
  729. if (this.grade < 100) {
  730. uni.navigateTo({
  731. url: '/pages/user/card'
  732. });
  733. }
  734. }
  735. }
  736. };
  737. </script>
  738. <style lang="scss">
  739. page {
  740. background: $page-color-base;
  741. padding-bottom: 100rpx;
  742. }
  743. .notice-bar {
  744. position: relative;
  745. top: 10rpx;
  746. }
  747. .navbar {
  748. display: flex;
  749. height: 80rpx;
  750. padding: 0 5px;
  751. background: #fff;
  752. box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.06);
  753. position: relative;
  754. z-index: 10;
  755. .nav-item {
  756. flex: 1;
  757. display: flex;
  758. justify-content: center;
  759. align-items: center;
  760. height: 100%;
  761. font-size: $font-lg + 4rpx;
  762. color: $font-color-dark;
  763. position: relative;
  764. &.current {
  765. color: $base-color;
  766. &:after {
  767. content: '';
  768. position: absolute;
  769. left: 50%;
  770. bottom: 0;
  771. transform: translateX(-50%);
  772. width: 140rpx;
  773. height: 0;
  774. border-bottom: 2px solid $base-color;
  775. }
  776. }
  777. }
  778. }
  779. .address-section {
  780. padding: 30rpx 0;
  781. background: #fff;
  782. position: relative;
  783. border-top: 1px solid $border-color-light;
  784. .order-content {
  785. min-height: 100rpx;
  786. display: flex;
  787. align-items: center;
  788. .addAddress {
  789. text-align: center;
  790. width: 100%;
  791. display: flex;
  792. justify-content: center;
  793. align-items: center;
  794. .iconaddition {
  795. font-size: 55rpx;
  796. line-height: 1;
  797. border-radius: 100rpx;
  798. margin-right: 20rpx;
  799. }
  800. }
  801. }
  802. .iconlocation {
  803. flex-shrink: 0;
  804. display: flex;
  805. align-items: center;
  806. justify-content: center;
  807. width: 90rpx;
  808. color: #888;
  809. font-size: 44rpx;
  810. }
  811. .cen {
  812. display: flex;
  813. flex-direction: column;
  814. flex: 1;
  815. font-size: 28rpx;
  816. color: $font-color-dark;
  817. }
  818. .name {
  819. font-size: 34rpx;
  820. margin-right: 24rpx;
  821. }
  822. .address {
  823. margin-top: 16rpx;
  824. margin-right: 20rpx;
  825. color: $font-color-light;
  826. }
  827. .icon-you {
  828. font-size: 32rpx;
  829. color: $font-color-light;
  830. margin-right: 30rpx;
  831. }
  832. .a-bg {
  833. position: absolute;
  834. left: 0;
  835. bottom: 0;
  836. display: block;
  837. width: 100%;
  838. height: 5rpx;
  839. }
  840. }
  841. .pink_name{
  842. position: absolute;
  843. top: 20rpx;
  844. left: 25rpx;
  845. z-index: 99;
  846. background-color: #FFF270;
  847. color: #934721;
  848. font-size: 22rpx;
  849. padding: 0rpx 8rpx;
  850. }
  851. .goods {
  852. padding: 15rpx 25rpx;
  853. padding-bottom: 25rpx;
  854. background: #ffffff;
  855. margin-top: 25rpx;
  856. .iconLeftTip {
  857. position: absolute;
  858. top: 20rpx;
  859. left: 0rpx;
  860. padding: 5rpx 10rpx;
  861. background-color: $color-red;
  862. color: #ffffff;
  863. font-size: $font-sm - 4rpx;
  864. }
  865. .goods-name {
  866. color: #141414;
  867. font-size: 24rpx;
  868. padding: 30rpx 0rpx;
  869. .name {
  870. font-size: 35rpx;
  871. }
  872. .red {
  873. color: #ff383e;
  874. }
  875. .time {
  876. text {
  877. padding-top: 7rpx;
  878. }
  879. }
  880. }
  881. .goods-section {
  882. position: relative;
  883. .g-header {
  884. display: flex;
  885. align-items: center;
  886. height: 84rpx;
  887. padding: 0 30rpx;
  888. position: relative;
  889. }
  890. .logo {
  891. display: block;
  892. width: 50rpx;
  893. height: 50rpx;
  894. border-radius: 100px;
  895. }
  896. .name {
  897. font-size: 30rpx;
  898. color: $font-color-base;
  899. margin-left: 24rpx;
  900. }
  901. .gift-item {
  902. display: flex;
  903. margin: 20rpx 30rpx;
  904. padding-top: 20rpx;
  905. position: relative;
  906. image {
  907. flex-shrink: 0;
  908. display: block;
  909. width: 140rpx;
  910. height: 140rpx;
  911. border-radius: 4rpx;
  912. }
  913. .right {
  914. flex: 1;
  915. padding-left: 24rpx;
  916. overflow: hidden;
  917. align-self: stretch;
  918. }
  919. .title {
  920. font-size: 30rpx;
  921. color: $font-color-dark;
  922. }
  923. .spec {
  924. font-size: 26rpx;
  925. color: $font-color-light;
  926. }
  927. .price-box {
  928. display: flex;
  929. align-items: center;
  930. font-size: 32rpx;
  931. color: $font-color-dark;
  932. padding-top: 10rpx;
  933. .price {
  934. margin-bottom: 4rpx;
  935. }
  936. .number {
  937. font-size: 26rpx;
  938. color: $font-color-base;
  939. margin-left: 20rpx;
  940. }
  941. }
  942. .step-box {
  943. position: relative;
  944. }
  945. }
  946. .g-item {
  947. width: 100%;
  948. font-size: 24rpx;
  949. height: 170rpx;
  950. .scroll-list {
  951. width: 80%;
  952. overflow: hidden;
  953. white-space: nowrap;
  954. .scoll-box {
  955. margin-right: 25rpx;
  956. text-align: center;
  957. display: inline-block;
  958. .scoll-img {
  959. width: 150rpx;
  960. height: 150rpx;
  961. border-radius: 100%;
  962. image {
  963. width: 150rpx;
  964. height: 100%;
  965. border-radius: 100%;
  966. }
  967. }
  968. }
  969. }
  970. .total {
  971. width: 20%;
  972. text-align: center;
  973. color: #515151;
  974. font-size: 26rpx !important;
  975. }
  976. }
  977. }
  978. }
  979. .green_card {
  980. background: #ffffff;
  981. padding: 30rpx 27rpx;
  982. width: 100%;
  983. margin-top: 15rpx;
  984. font-size: 26rpx;
  985. .box {
  986. background: #f5f5f5;
  987. padding: 25rpx 25rpx;
  988. .img {
  989. width: 100rpx;
  990. height: 40rpx;
  991. margin-bottom: 15rpx;
  992. image {
  993. width: 100%;
  994. height: 100%;
  995. }
  996. }
  997. .list {
  998. .tpl {
  999. .tip {
  1000. color: #425272;
  1001. text {
  1002. color: #ff383e;
  1003. }
  1004. }
  1005. .top {
  1006. color: #999999;
  1007. padding-top: 15rpx;
  1008. }
  1009. .money {
  1010. padding-right: 10rpx;
  1011. }
  1012. }
  1013. .member {
  1014. color: #425272;
  1015. }
  1016. }
  1017. }
  1018. }
  1019. .yt-list {
  1020. margin-top: 16rpx;
  1021. background: #fff;
  1022. }
  1023. .yt-list-cell {
  1024. display: flex;
  1025. align-items: center;
  1026. padding: 10rpx 30rpx 10rpx 40rpx;
  1027. line-height: 70rpx;
  1028. position: relative;
  1029. &.cell-hover {
  1030. background: #fafafa;
  1031. }
  1032. &.b-b:after {
  1033. left: 30rpx;
  1034. }
  1035. .cell-icon {
  1036. height: 32rpx;
  1037. width: 32rpx;
  1038. font-size: 22rpx;
  1039. color: #fff;
  1040. text-align: center;
  1041. line-height: 32rpx;
  1042. background: #f85e52;
  1043. border-radius: 4rpx;
  1044. margin-right: 12rpx;
  1045. &.hb {
  1046. background: #ffaa0e;
  1047. }
  1048. &.lpk {
  1049. background: #3ab54a;
  1050. }
  1051. }
  1052. .cell-more {
  1053. align-self: center;
  1054. font-size: 24rpx;
  1055. color: $font-color-light;
  1056. margin-left: 8rpx;
  1057. margin-right: -10rpx;
  1058. }
  1059. .cell-tit {
  1060. flex: 1;
  1061. font-size: 26rpx;
  1062. color: $font-color-light;
  1063. margin-right: 10rpx;
  1064. }
  1065. .cell-tip {
  1066. font-size: 26rpx;
  1067. color: $font-color-dark;
  1068. &.disabled {
  1069. color: $font-color-light;
  1070. }
  1071. &.active {
  1072. color: #b3b3b3;
  1073. }
  1074. &.red {
  1075. color: $base-color;
  1076. }
  1077. }
  1078. &.desc-cell {
  1079. .cell-tit {
  1080. max-width: 90rpx;
  1081. }
  1082. }
  1083. .desc {
  1084. flex: 1;
  1085. text-align: right;
  1086. font-size: $font-base;
  1087. color: $font-color-dark;
  1088. }
  1089. }
  1090. .info {
  1091. margin-top: 25rpx;
  1092. background: #ffffff;
  1093. padding-top: 25rpx !important;
  1094. margin-bottom: 25rpx !important;
  1095. padding: 0rpx 25rpx;
  1096. font-size: 28rpx;
  1097. color: #909399;
  1098. view {
  1099. padding-bottom: 10rpx;
  1100. }
  1101. }
  1102. .red {
  1103. color: #ff1a27;
  1104. }
  1105. /* 支付列表 */
  1106. .pay-list {
  1107. padding-left: 40rpx;
  1108. margin-top: 16rpx;
  1109. background: #fff;
  1110. .pay-item {
  1111. display: flex;
  1112. align-items: center;
  1113. padding-right: 20rpx;
  1114. line-height: 1;
  1115. height: 110rpx;
  1116. position: relative;
  1117. }
  1118. .icon-weixinzhifu {
  1119. width: 80rpx;
  1120. font-size: 40rpx;
  1121. color: #6bcc03;
  1122. }
  1123. .icon-alipay {
  1124. width: 80rpx;
  1125. font-size: 40rpx;
  1126. color: #06b4fd;
  1127. }
  1128. .icon-xuanzhong2 {
  1129. display: flex;
  1130. align-items: center;
  1131. justify-content: center;
  1132. width: 60rpx;
  1133. height: 60rpx;
  1134. font-size: 40rpx;
  1135. color: $base-color;
  1136. }
  1137. .tit {
  1138. font-size: 32rpx;
  1139. color: $font-color-dark;
  1140. flex: 1;
  1141. }
  1142. }
  1143. .footer {
  1144. position: fixed;
  1145. left: 0;
  1146. bottom: 0;
  1147. z-index: 995;
  1148. display: flex;
  1149. align-items: center;
  1150. width: 100%;
  1151. height: 90rpx;
  1152. justify-content: space-between;
  1153. font-size: 30rpx;
  1154. background-color: #fff;
  1155. z-index: 998;
  1156. color: $font-color-base;
  1157. box-shadow: 0 -1px 5px rgba(0, 0, 0, 0.1);
  1158. .price-content {
  1159. padding-left: 30rpx;
  1160. }
  1161. .price-tip {
  1162. color: #ff383e;
  1163. margin-left: 8rpx;
  1164. }
  1165. .price {
  1166. font-size: 36rpx;
  1167. color: #ff383e;
  1168. }
  1169. .submit {
  1170. display: flex;
  1171. align-items: center;
  1172. justify-content: center;
  1173. width: 280rpx;
  1174. height: 100%;
  1175. color: #fff;
  1176. font-size: 32rpx;
  1177. background-color: $base-color;
  1178. &.submitNo {
  1179. background-color: $font-color-disabled;
  1180. }
  1181. }
  1182. }
  1183. .check_box {
  1184. padding: 0rpx 25rpx;
  1185. font-size: 28rpx;
  1186. text{
  1187. color: #3DCF35;
  1188. }
  1189. .ziti-text {
  1190. color: $base-color;
  1191. text-decoration: underline;
  1192. }
  1193. }
  1194. /* 优惠券面板 */
  1195. .mask {
  1196. display: flex;
  1197. align-items: flex-end;
  1198. position: fixed;
  1199. left: 0;
  1200. top: var(--window-top);
  1201. bottom: 0;
  1202. width: 100%;
  1203. background: rgba(0, 0, 0, 0);
  1204. z-index: 9995;
  1205. transition: 0.3s;
  1206. .mask-content {
  1207. width: 100%;
  1208. max-height: 70vh;
  1209. background: #f3f3f3;
  1210. transform: translateY(100%);
  1211. transition: 0.3s;
  1212. overflow-y: scroll;
  1213. border-top-left-radius: 25rpx;
  1214. border-top-right-radius: 25rpx;
  1215. .name {
  1216. width: 100%;
  1217. text-align: center;
  1218. padding: 15rpx 15rpx;
  1219. margin-top: 15rpx;
  1220. }
  1221. }
  1222. &.none {
  1223. display: none;
  1224. }
  1225. &.show {
  1226. background: rgba(0, 0, 0, 0.4);
  1227. .mask-content {
  1228. transform: translateY(0);
  1229. }
  1230. }
  1231. }
  1232. /* 优惠券列表 */
  1233. .coupon-item {
  1234. margin: 20rpx 24rpx;
  1235. background: #fff;
  1236. font-size: 26rpx;
  1237. height: 170rpx;
  1238. .left {
  1239. background: #eef9f1;
  1240. width: 28%;
  1241. height: 170rpx;
  1242. text-align: center;
  1243. color: #2dbd59;
  1244. .left-price {
  1245. padding-top: 25%;
  1246. text {
  1247. font-size: 59rpx;
  1248. font-weight: bold;
  1249. }
  1250. }
  1251. }
  1252. .right {
  1253. width: 72%;
  1254. height: 170rpx;
  1255. padding: 0rpx 25rpx;
  1256. .info-name {
  1257. font-weight: bold;
  1258. font-size: 30rpx;
  1259. }
  1260. .info-tip {
  1261. color: #999999;
  1262. font-size: 22rpx;
  1263. padding: 5rpx 0rpx;
  1264. }
  1265. .right-submit {
  1266. background: #2dbd59;
  1267. color: #ffffff;
  1268. border-radius: 25rpx;
  1269. padding: 10rpx 15rpx;
  1270. }
  1271. }
  1272. }
  1273. //配送券
  1274. .deliveryState {
  1275. border-radius: 15rpx;
  1276. margin: 20rpx 24rpx;
  1277. height: 200rpx;
  1278. overflow: hidden;
  1279. background: #ffffff;
  1280. .list-interval {
  1281. border: 1px dashed $border-color-light;
  1282. height: 100%;
  1283. .top,
  1284. .bottom {
  1285. border-radius: 100rpx;
  1286. width: 30rpx;
  1287. height: 30rpx;
  1288. position: absolute;
  1289. background-color: $page-color-base;
  1290. right: -15rpx;
  1291. }
  1292. .top {
  1293. top: -18rpx;
  1294. }
  1295. .bottom {
  1296. bottom: -18rpx;
  1297. }
  1298. }
  1299. .list-money {
  1300. height: 100%;
  1301. image {
  1302. height: 100%;
  1303. width: 20rpx;
  1304. margin-right: 10rpx;
  1305. position: relative;
  1306. }
  1307. .list-money-text {
  1308. width: 220rpx;
  1309. padding: 0 25rpx;
  1310. text-align: center;
  1311. color: #fc4141;
  1312. .tit {
  1313. padding: 15rpx 0rpx;
  1314. font-size: 55rpx;
  1315. font-weight: bold;
  1316. }
  1317. .price {
  1318. padding-bottom: 25rpx;
  1319. color: #999999;
  1320. font-size: 24rpx;
  1321. }
  1322. }
  1323. }
  1324. .row_list_right {
  1325. width: 60%;
  1326. font-size: 26rpx;
  1327. .title {
  1328. text {
  1329. color: #fc4141;
  1330. font-size: 30rpx;
  1331. }
  1332. }
  1333. .text {
  1334. padding: 7rpx;
  1335. color: #999999;
  1336. }
  1337. .use {
  1338. margin-top: 15rpx;
  1339. text {
  1340. border: 2rpx solid #313131;
  1341. padding: 7rpx 20rpx;
  1342. border-radius: 25rpx;
  1343. }
  1344. }
  1345. }
  1346. }
  1347. //商品券
  1348. .goodsState {
  1349. border-radius: 15rpx;
  1350. margin: 20rpx 24rpx;
  1351. height: 200rpx;
  1352. overflow: hidden;
  1353. .img {
  1354. width: 30rpx;
  1355. height: 200rpx;
  1356. image {
  1357. height: 100%;
  1358. width: 100%;
  1359. }
  1360. }
  1361. .delivery-box {
  1362. background: linear-gradient(270deg, rgba(111, 178, 47, 1) 0%, rgba(160, 217, 106, 1) 100%);
  1363. width: 100%;
  1364. height: 100%;
  1365. color: #ffffff;
  1366. .list-money {
  1367. height: 100%;
  1368. font-size: 22rpx;
  1369. text-align: center;
  1370. padding-top: 4%;
  1371. padding-left: 10rpx;
  1372. .tit {
  1373. text {
  1374. font-size: 80rpx;
  1375. }
  1376. }
  1377. }
  1378. .row_list_right {
  1379. width: 43%;
  1380. font-size: 26rpx;
  1381. .title {
  1382. text {
  1383. color: #fc4141;
  1384. font-size: 30rpx;
  1385. }
  1386. }
  1387. .text {
  1388. padding: 7rpx;
  1389. color: #ffffff;
  1390. font-size: 20rpx;
  1391. }
  1392. }
  1393. .use {
  1394. margin-top: 15rpx;
  1395. text {
  1396. background-color: #ffffff;
  1397. font-size: 26rpx;
  1398. padding: 12rpx 30rpx;
  1399. border-radius: 25rpx;
  1400. color: rgba(111, 178, 47, 1);
  1401. }
  1402. }
  1403. }
  1404. }
  1405. .pop-box {
  1406. background: #FFFFFF;
  1407. width: 500rpx;
  1408. border-radius: 15rpx;
  1409. text-align: center;
  1410. .pop-tit {
  1411. font-size: $font-base;
  1412. padding-top: 60rpx;
  1413. }
  1414. .pop-buttom {
  1415. display: flex;
  1416. align-items: center;
  1417. margin-top: 40rpx;
  1418. border-bottom-left-radius: 15rpx;
  1419. border-bottom-right-radius: 15rpx;
  1420. border: 1px solid #f0f0f0;
  1421. height: 80rpx;
  1422. .pop-sub {
  1423. flex: 1;
  1424. text-align: center;
  1425. font-size: $font-base;
  1426. border-right: 1px solid #f0f0f0;
  1427. &:last-of-type {
  1428. border-right: 0;
  1429. }
  1430. }
  1431. }
  1432. }
  1433. </style>