Commit 8db259412d28ff9c6c802a496e637c63fde40480

Authored by 李宇
1 parent 42cbd54c

2

Showing 30 changed files with 6648 additions and 3144 deletions
admin-web-master/src/api/couponmanagement/couponlist.js
1 1 import request from '@/utils/request'
  2 +// 优惠券统计
  3 +export function couponStatistics(data) {
  4 + return request({
  5 + url: '/cereCouponMainTable/couponStatistics',
  6 + method: 'post',
  7 + data
  8 + })
  9 +}
  10 +// 资金池统计
  11 +export function fundPoolStatistics(data) {
  12 + return request({
  13 + url: '/cereCouponMainTable/fundPoolStatistics',
  14 + method: 'post',
  15 + data
  16 + })
  17 +}
2 18 // 获取优惠券
3 19 export function myCoupons(data) {
4 20 return request({
... ...
admin-web-master/src/router/index.js
... ... @@ -744,39 +744,6 @@ export const mainRoutes = [
744 744 component: () => import('@/views/404'),
745 745 hidden: true
746 746 },
747   -
748   -
749   - {
750   - path: '/other',
751   - component: Layout,
752   - redirect: '/other/coupon',
753   - hidden: true,
754   - name: 'setup',
755   - meta: {
756   - title: '优惠券管理',
757   - icon: 'el-icon-s-help'
758   - },
759   - children: [
760   - {
761   - path: 'coupon',
762   - name: 'coupon',
763   - component: () => import('@/views/couponmanagement/couponinfo'),
764   - meta: {
765   - title: '优惠券详情',
766   - icon: 'tree'
767   - }
768   - },
769   - {
770   - path: 'capitalpoolinfo',
771   - name: 'capitalpoolinfo',
772   - component: () => import('@/views/couponmanagement/capitalpoolinfo'),
773   - meta: {
774   - title: '资金池详情',
775   - icon: 'tree'
776   - }
777   - }
778   - ]
779   - },
780 747 {
781 748 path: '/setup',
782 749 component: Layout,
... ...
admin-web-master/src/utils/request.js
... ... @@ -21,7 +21,7 @@ if (host == '172.16.61.48' || host == '172.16.61.49 :5173' || host =='172.16.61.
21 21 // PREFIX = 'http://172.16.61.48/meserver/admin-server';
22 22 // PREFIX = 'http://192.168.2.213:9003';
23 23 // PREFIX = 'http://8.130.38.56:8019/admin-server';
24   - PREFIX = 'http://192.168.8.106:9003';
  24 + PREFIX = 'http://8.130.38.56:9003';
25 25 // PREFIX = 'https://wjdc.scjysm.asia:1443/meserver/admin-server';
26 26 // PREFIX = 'https://jy.scjysm.asia:18086/meserver/admin-server';
27 27 // PREFIX = 'http://172.16.61.126:8080/meserver/admin-server';
... ...
admin-web-master/src/views/couponmanagement/allinfo.vue 0 → 100644
  1 +<template>
  2 + <div>
  3 + <!-- 根据 type 的值决定显示哪个组件 -->
  4 + <capitalpoolinfo ref="capitalpoolinforef" v-if="type == '1'" @changecouponid="changecouponid"/>
  5 + <couponinfo ref="couponinforef" v-else-if="type == '2'" @changecouponid="changecouponid"/>
  6 + </div>
  7 +</template>
  8 +
  9 +<script>
  10 +import capitalpoolinfo from './capitalpoolinfo.vue';
  11 +import couponinfo from './couponinfo.vue';
  12 +
  13 +export default {
  14 + components: {
  15 + capitalpoolinfo,
  16 + couponinfo
  17 + },
  18 + props: {
  19 + type: {
  20 + type: String,
  21 + required: '1'
  22 + },
  23 + },
  24 + data() {
  25 + return {
  26 + id: ''
  27 + }
  28 + },
  29 + methods: {
  30 + int(e) {
  31 + if(this.type === '1'){
  32 + this.$refs.capitalpoolinforef.int(e)
  33 + }else{
  34 + this.$refs.couponinforef.int(e)
  35 + }
  36 + },
  37 + chanetype(e) {
  38 + this.type = e
  39 + },
  40 + changecouponid(e) {
  41 + console.error(e)
  42 + let c1 = {
  43 + type:'2',
  44 + id:e
  45 + }
  46 + this.$emit('changetypeinfo',c1)
  47 + // this.$refs.couponinforef.int(e)
  48 + },
  49 + changecapitalpoolid(e) {
  50 +
  51 + },
  52 + },
  53 +};
  54 +</script>
  55 +
  56 +<style scoped>
  57 +/* 添加样式 */
  58 +</style>
0 59 \ No newline at end of file
... ...
admin-web-master/src/views/couponmanagement/capitalpool.vue
1 1 <template>
2 2 <div style="background-color:#f7f7f7;padding:10px 10px;">
3   - <div class="couponPage" v-show="type == '1'">
  3 + <div class="couponPage" v-if="type == '1'">
4 4 <div>
5 5 <div style="height:58px;line-height:58px;">
6 6 <div style="color:#0006"> <span>优惠券管理</span> <span style="padding:0 5px;">></span> <span
... ... @@ -115,7 +115,7 @@
115 115 </el-dialog>
116 116 </div>
117 117 </div>
118   - <div class="couponPage" v-show="type == '2'">
  118 + <div class="couponPage" v-if="type == '2'">
119 119 <div style="height:58px;line-height:58px;">
120 120 <div style="color:#0006"> <span>优惠券管理</span> <span style="padding:0 5px;">></span> <span
121 121 style="color:#000000e6">创建优惠券</span></div>
... ... @@ -134,6 +134,17 @@
134 134 </div>
135 135 </div>
136 136 </div>
  137 + <div class="couponPage" v-show="type == '3'">
  138 + <div style="height:58px;line-height:58px;">
  139 + <div style="color:#0006"> <span>优惠券管理</span> <span style="padding:0 5px;">></span> <span
  140 + style="color:#000000e6">详情</span></div>
  141 + </div>
  142 + <allinfo v-show="typeinfo =='1'" :id="poolId" ref="allinforef" :type="typeinfo" @changetypeinfo="changetypeinfo" />
  143 + <allinfo v-if="typeinfo =='2'" :id="poolId" :type="typeinfo" @changetypeinfo="changetypeinfo" />
  144 + <div style="display: flex;">
  145 + <el-button @click="changetype()" class="buttonHover" style="color: #606266;border: 1px solid #dddfe5;background-color: #fff;" >返回</el-button>
  146 + </div>
  147 + </div>
137 148 </div>
138 149 </template>
139 150  
... ... @@ -149,14 +160,17 @@
149 160 } from '@/api/couponmanagement/capitalpool.js'
150 161 import router from '@/router';
151 162 import coupon from './coupon.vue';
  163 + import allinfo from './allinfo.vue';
152 164 import TitleWithCircle from '@/components/top/index';
153 165 export default {
154 166  
155 167 components: {
156   - coupon,TitleWithCircle
  168 + coupon,TitleWithCircle,allinfo
157 169 },
158 170 data() {
159 171 return {
  172 + poolId:'',
  173 + typeinfo:'1',
160 174 couponRules: {
161 175 poolName: [{
162 176 required: true,
... ... @@ -184,6 +198,7 @@
184 198 useCategorylist:'',
185 199 usedMerchantslist:'',
186 200 couponfrom: {
  201 + receiveAgain:0,
187 202 usedMerchants: 1,
188 203 couponName: '',
189 204 remark: '',
... ... @@ -195,7 +210,7 @@
195 210 pointsRequired: 0,
196 211 startTime: '',
197 212 endTime: '',
198   - totalCoupons: null,
  213 + totalCoupons: 1,
199 214 totalFunds: null,
200 215 },
201 216 coupoobj: {},
... ... @@ -240,42 +255,104 @@
240 255 this.getAll()
241 256 },
242 257 methods: {
  258 + changetypeinfo(e) {
  259 + let that = this
  260 + this.typeinfo = e.type
  261 + setTimeout(()=>{
  262 + that.$refs.allinforef.int(e.id)
  263 + },300)
  264 + },
  265 + changetype() {
  266 + let that = this
  267 + if(this.typeinfo == '1') {
  268 + this.type = 1
  269 + } else {
  270 + this.typeinfo = '1'
  271 + console.error(this.poolId)
  272 + //延迟执行this.$refs.allinforef.int(this.poolId)
  273 + setTimeout(()=>{
  274 + that.$refs.allinforef.int(this.poolId)
  275 + },300)
  276 + }
  277 + },
243 278 changevalue(e,list) {
244 279 console.error(e,list )
245 280 this[e] = list
246 281 },
247 282 xq(e) {
248 283 console.log(e )
249   - // 跳转路由
250   - router.push({
251   - path: '/other/capitalpoolinfo',
252   - query: {
253   - id: e.poolId
254   - }
255   - })
  284 + this.type = '3'
  285 + this.typeinfo = '1'
  286 + this.poolId = e.poolId
  287 + this.$refs.allinforef.int(this.poolId)
  288 + // // 跳转路由
  289 + // router.push({
  290 + // path: '/other/capitalpoolinfo',
  291 + // query: {
  292 + // id: e.poolId
  293 + // }
  294 + // })
256 295 },
257 296 savecoupon() {
258 297 let that = this
  298 + console.error(this.couponfrom )
259 299 if(!this.couponfrom.couponName) {
  300 + that.$message({
  301 + message: '请填写优惠券名称',
  302 + error: 'success'
  303 + });
260 304 return
261 305 }
262   - if(!this.couponfrom.startTime) {
263   - return
264   - }
265   - if(!this.couponfrom.totalCoupons) {
266   - return
267   - }
268   - if(!this.couponfrom.maxDiscountAmount) {
269   - return
270   - }
  306 +
  307 +
271 308 if(!this.couponfrom.discountContent) {
  309 + that.$message({
  310 + message: '请填写优惠内容',
  311 + error: 'success'
  312 + });
272 313 return
273 314 }
  315 +
  316 +
274 317 if(this.couponfrom.couponType == '1') {
275   - if(Number(this.couponfrom.discountContent) >= Number(this.couponfrom.maxDiscountAmount)) {
  318 + if(!this.couponfrom.usageThreshold) {
  319 + that.$message({
  320 + message: '请填写优惠内容',
  321 + error: 'success'
  322 + });
  323 + return
  324 + }
  325 + if(Number(this.couponfrom.discountContent) >= Number(this.couponfrom.usageThreshold)) {
  326 + that.$message({
  327 + message: '请满减金额大于优惠金额',
  328 + error: 'success'
  329 + });
276 330 return
277 331 }
278   - }
  332 + } else {
  333 + if(!this.couponfrom.maxDiscountAmount) {
  334 + that.$message({
  335 + message: '请填写优惠内容',
  336 + error: 'success'
  337 + });
  338 + return
  339 + }
  340 +
  341 + }
  342 + if(!this.couponfrom.startTime) {
  343 + that.$message({
  344 + message: '请选择时间',
  345 + error: 'success'
  346 + });
  347 + return
  348 + }
  349 + if(!this.couponfrom.totalCoupons) {
  350 + that.$message({
  351 + message: '请填写数量',
  352 + error: 'success'
  353 + });
  354 + return
  355 + }
279 356 let c1 = this.changecouponfrom()
280 357 console.error(c1)
281 358 console.error(this.useCategorylist)
... ... @@ -322,6 +399,22 @@
322 399 console.error(res2)
323 400 })
324 401 }
  402 + this.couponfrom={
  403 + receiveAgain:0,
  404 + usedMerchants: 1,
  405 + couponName: '',
  406 + remark: '',
  407 + couponType: '1', // 默认值
  408 + useCategory: 1,
  409 + maxDiscountAmount: null,
  410 + usageThreshold: null, //使用门槛不用
  411 + discountContent: null,
  412 + pointsRequired: 0,
  413 + startTime: '',
  414 + endTime: '',
  415 + totalCoupons: 1,
  416 + totalFunds: null,
  417 + }
325 418 that.$message({
326 419 message: '提交成功',
327 420 type: 'success'
... ... @@ -332,9 +425,7 @@
332 425 error: 'success'
333 426 });
334 427 }
335   - setTimeout(() => {
336   - that.type = '1'
337   - }, 2000)
  428 + that.type = '1'
338 429 })
339 430 },
340 431 changecouponfrom() {
... ...
admin-web-master/src/views/couponmanagement/capitalpoolinfo.vue
1 1 <template>
2   - <div style="background-color:#f7f7f7;padding:10px 10px;">
3   - <div class="couponPage" >
4   - <div>
5   - <div style="height:58px;line-height:58px;">
6   - <div style="color:#0006"> <span>优惠券管理</span> <span style="padding:0 5px;">></span> <span>资金池</span> <span style="padding:0 5px;">></span><span style="color:#000000e6">详情</span></div>
7   - </div>
8   - <div style="display: flex;margin-bottom: 10px;">
  2 + <div >
  3 + <div style="display: flex;margin-bottom: 10px;">
9 4 <div v-for="item in typelist" style="width: 30%;margin-right: 3%;text-align: center;padding: 20px 0;border-radius: 3px;border: 2px solid #eee;">
10 5 <div style="font-size: 14px;color: #a8abb2;">{{item.type}}</div>
11 6 <div style="font-size: 22px;margin-top: 10px;color: rgb(63, 155, 106);">{{item.num}}</div>
... ... @@ -47,7 +42,7 @@
47 42 </el-table-column>
48 43 <el-table-column label="优惠内容">
49 44 <template slot-scope="scope">
50   - <span v-if="scope.row.couponType == '1'">满{{ scope.row.maxDiscountAmount }}减{{ scope.row.discountContent }}</span>
  45 + <span v-if="scope.row.couponType == '1'">满{{ scope.row.usageThreshold }}减{{ scope.row.discountContent }}</span>
51 46 <span v-else-if="scope.row.couponType == '2'">{{ scope.row.discountContent }}折 最高减{{ scope.row.maxDiscountAmount }}</span>
52 47 </template>
53 48 </el-table-column>
... ... @@ -69,7 +64,7 @@
69 64 <div style="display: flex;justify-content: space-between;margin: 20px 0;">
70 65 <div style="font-size: 14px;">共 <span style="color: #3F9B6A;">{{total}}</span> 项数据</div>
71 66 <el-pagination
72   - :current-page="query.pageNumber"
  67 + :current-page="query.pageNumber+1"
73 68 :page-sizes="[10, 20, 50, 100]"
74 69 :page-size="10"
75 70 background
... ... @@ -80,18 +75,13 @@
80 75 @current-change="handleCurrentChange">
81 76 </el-pagination>
82 77 </div>
83   - <div style="display: flex;">
84   - <router-link to="/other/capitalpoolinfo"> <el-button class="buttonHover" style="color: #606266;border: 1px solid #dddfe5;background-color: #fff;" >返回</el-button></router-link>
85   - </div>
86 78 </div>
87   - </div>
88   - </div>
89 79  
90 80 </div>
91 81 </template>
92 82  
93 83 <script>
94   - import { getcereFundsPoolData,addcereFundsPool,delPool,editPool,batchGenerateCoupons}from '@/api/couponmanagement/couponlist.js'
  84 + import { getcereFundsPoolData,fundPoolStatistics}from '@/api/couponmanagement/couponlist.js'
95 85 import router from '@/router';
96 86 import coupon from './coupon.vue';
97 87  
... ... @@ -126,19 +116,18 @@
126 116 },
127 117 ],
128 118 query: {
129   - fundPoolId:'',
130 119 couponName: '', //名称
131   - pageNumber: 1,
  120 + pageNumber: 0,
132 121 pageSize: 10
133 122 },
  123 + fundPoolId:'',
134 124 total: 0,
135 125 tableData: [],
136 126 }
137 127 },
138 128 created () {
139   - this.getAll()
140   - console.log(this.$route.query.id)
141   - this.query.fundPoolId = this.$route.query.id
  129 +
  130 +
142 131 },
143 132 methods: {
144 133 handleClick(tab, event) {
... ... @@ -146,15 +135,26 @@
146 135 },
147 136 xq(e) {
148 137 // 跳转路由
149   - router.push({
150   - path: '/other/coupon',
151   - query: {
152   - id: e.id
153   - }
  138 + // router.push({
  139 + // path: '/other/coupon',
  140 + // query: {
  141 + // id: e.id
  142 + // }
  143 + // })
  144 + //调用父组件
  145 + console.error(e.id)
  146 + this.$emit('changecouponid',e.id)
  147 + },
  148 + int(e) {
  149 + this.fundPoolId = e
  150 + fundPoolStatistics({poolId:this.fundPoolId}).then(res=>{
  151 + console.error(res)
154 152 })
  153 + this.clear()
155 154 },
156 155 async getAll () {
157   - const res = await getcereFundsPoolData(this.query)
  156 + console.error(this.fundPoolId)
  157 + const res = await getcereFundsPoolData({fundPoolId:this.fundPoolId,...this.query})
158 158 console.error(res.data.content)
159 159 this.tableData = res.data.content
160 160 this.total = res.data.numberOfElements
... ... @@ -164,18 +164,21 @@
164 164 this.getAll()
165 165 },
166 166 handleCurrentChange (val) {
167   - this.query.pageNumber = val
  167 + this.query.pageNumber = val-1
168 168 this.getAll()
169 169 },
170 170 search () {
171 171 this.total = 1
172   - this.query.pageNumber = 1
  172 + this.query.pageNumber = 0
173 173 this.getAll()
174 174 },
175 175 // 重置
176 176 clear () {
177   - this.query.couponName = ''
178   - this.query.pageNumber = 1
  177 + this.query = {
  178 + couponName: '', //名称
  179 + pageNumber: 0,
  180 + pageSize: 10
  181 + }
179 182 this.getAll()
180 183 },
181 184  
... ...
admin-web-master/src/views/couponmanagement/coupon.vue
... ... @@ -15,17 +15,18 @@
15 15 <el-radio v-model="couponfrom.couponType" label="1">满减券</el-radio>
16 16 <el-radio v-model="couponfrom.couponType" label="2">折扣券</el-radio>
17 17 </el-form-item>
18   - <el-form-item v-if="couponfrom.couponType === '1'" class="inputW" label="优惠内容" prop="maxDiscountAmount">
19   - 订单满 <el-input-number v-model="couponfrom.maxDiscountAmount" :controls="false" :min="0" :precision="2" :step="0.01" /> 元 减 <el-input-number v-model="couponfrom.discountContent" :controls="false" :min="0" :precision="2" :step="0.01" /> 元
  18 + <el-form-item v-if="couponfrom.couponType === '1'" class="inputW" label="优惠内容" prop="usageThreshold">
  19 + 订单满 <el-input-number v-model="couponfrom.usageThreshold" :controls="false" :min="0" :precision="2" :step="0.01" /> 元 减 <el-input-number v-model="couponfrom.discountContent" :controls="false" :min="0" :precision="2" :step="0.01" /> 元
20 20 </el-form-item>
21 21 <el-form-item v-else class="inputW discount" label="优惠内容" prop="discountContent">
  22 +
  23 + 打 <el-input-number v-model="couponfrom.discountContent" :controls="false" :min="0" :max="9.9" :precision="1" :step="0.1" /> 折
22 24 <span v-if="couponfrom.couponType === '2'" style="margin-right: 10px;">
23 25 最高优惠金额
24 26 <el-input-number v-model="couponfrom.maxDiscountAmount" :controls="false" :min="0" :precision="2" :step="0.01" /> 元
25 27 </span>
26   - 打 <el-input-number v-model="couponfrom.discountContent" :controls="false" :min="0" :max="9.9" :precision="1" :step="0.1" /> 折
27   - <label>输入值要大于0 小于10,可保留一位小数</label>
28   -
  28 + <label>折数输入值要大于0 小于10,可保留一位小数</label>
  29 +
29 30 </el-form-item>
30 31 <!-- <el-form-item v-if="couponfrom.couponType === '2'" class="inputW" label="最高优惠金额" prop="maxDiscountAmount">
31 32 <el-input-number v-model="couponfrom.maxDiscountAmount" :controls="false" :min="0" :precision="2" :step="0.01" /> 元
... ... @@ -81,6 +82,12 @@
81 82 <el-input v-model="couponfrom.pointsRequired" type="number" style="width: 150px" /> 分
82 83 </el-form-item>
83 84 </div>
  85 + <el-form-item label="是否重复领用:">
  86 + <el-radio-group v-model="couponfrom.receiveAgain">
  87 + <el-radio :label="1" >是</el-radio>
  88 + <el-radio :label="0" >否</el-radio>
  89 + </el-radio-group>
  90 + </el-form-item>
84 91 <el-form-item class="timeDataBox" label="用券时间" prop="startTime">
85 92 <el-date-picker
86 93 v-model="dateInfo"
... ... @@ -93,7 +100,8 @@
93 100 />
94 101 </el-form-item>
95 102 <el-form-item class="boxWidth" label="数量" prop="totalCoupons">
96   - <el-input v-model="couponfrom.totalCoupons" type="number" oninput="value=value.replace(/[^\d]/g,'')" />张 <span v-if="coupoobj.symon && changecouponfrom()!=0">(最大:{{ (coupoobj.symon/changecouponfrom()).toFixed(0) }} 张)</span>
  103 + <el-input-number v-model="couponfrom.totalCoupons" :controls="false" :min="1" :max="changemax" :precision="0" :step="1" /> 张 <span >(最大:{{ changemax}} 张)</span>
  104 + <!-- <el-input v-model="couponfrom.totalCoupons" :controls="false" type="number" :min="1" oninput="value=value.replace(/[^\d]/g,'')" />张 <span v-if="coupoobj.symon && changecouponfrom()!=0">(最大:{{ (coupoobj.symon/changecouponfrom()).toFixed(0) }} 张)</span> -->
97 105 </el-form-item>
98 106 <el-form-item label="备注">
99 107 <el-input maxlength="200" show-word-limit rows="4" v-model="couponfrom.remark" placeholder="请输入备注" type="textarea" />
... ... @@ -128,21 +136,33 @@
128 136 },
129 137 },
130 138 data() {
131   - var moneyContent = (rule, value, callback) => {
132   - if(!this.couponfrom.maxDiscountAmount) {
133   - return callback(new Error('请输入优惠内容'));
  139 + var moneyContentusageThreshold = (rule, value, callback) => {
  140 +
  141 + if(!this.couponfrom.usageThreshold) {
  142 + return callback(new Error('请输入优惠门槛'));
134 143 }
135 144 if(!this.couponfrom.discountContent) {
136 145 return callback(new Error('请输入优惠内容'));
137 146 }
138 147 if(this.couponfrom.couponType == '1') {
139   - if(Number(this.couponfrom.discountContent) >= Number(this.couponfrom.maxDiscountAmount)) {
  148 + if(Number(this.couponfrom.discountContent) >= Number(this.couponfrom.usageThreshold)) {
140 149 return callback(new Error('请满减金额大于优惠金额'));
141 150 }
142 151 }
143 152 callback();
144 153 }
  154 + var moneyContentdiscountContent = (rule, value, callback) => {
  155 + if(!this.couponfrom.discountContent) {
  156 + return callback(new Error('请输入优惠内容'));
  157 + }
  158 + if(!this.couponfrom.maxDiscountAmount) {
  159 + return callback(new Error('请输入最高优惠'));
  160 + }
  161 +
  162 + callback();
  163 + }
145 164 return {
  165 + changemax:9999,
146 166 monys:0,
147 167 usedMerchants:null,
148 168 pointsRequired:0,
... ... @@ -156,13 +176,23 @@
156 176 couponName: [
157 177 { required: true, message: '请输入优惠券名称', trigger: 'blur' }
158 178 ],
159   - maxDiscountAmount: [ { validator: moneyContent, trigger: 'blur' }],
  179 + usageThreshold: [ { validator: moneyContentusageThreshold, trigger: 'blur' }],
  180 + discountContent: [ { validator: moneyContentdiscountContent, trigger: 'blur' }],
160 181 startTime: [{required: true, message: '请选择时间', trigger: 'blur'}],
161 182 totalCoupons: [{ required: true, message: '请输入数量', trigger: 'blur' }]
162 183 },
163 184 }
164 185 },
165 186 watch: {
  187 + 'couponfrom.discountContent'(val) {
  188 + this.setchangemax()
  189 + },
  190 + 'couponfrom.usageThreshold'(val) {
  191 + this.setchangemax()
  192 + },
  193 + 'couponfrom.maxDiscountAmount'(val) {
  194 + this.setchangemax()
  195 + },
166 196 'couponfrom.couponType'(val) {
167 197 this.couponfrom.maxDiscountAmount = 0
168 198 this.couponfrom.discountContent = 0
... ... @@ -184,6 +214,13 @@
184 214 this.getAll()
185 215 },
186 216 methods: {
  217 + setchangemax(){
  218 + if(this.coupoobj.symon && this.changecouponfrom()!=0) {
  219 + this.changemax = Number((this.coupoobj.symon/this.changecouponfrom()).toFixed(0))
  220 + } else {
  221 + this.changemax = 999999
  222 + }
  223 + },
187 224 changeuseCategory(e){
188 225 this.$emit('changevalue','useCategorylist',e)
189 226 },
... ...
admin-web-master/src/views/couponmanagement/couponinfo.vue
1 1 <template>
2   - <div style="background-color:#f7f7f7;padding:10px 10px;">
3   - <div class="couponPage" >
4   - <div>
5   - <div style="height:58px;line-height:58px;">
6   - <div style="color:#0006"> <span>优惠券管理</span> <span style="padding:0 5px;">></span> <span>优惠券列表</span> <span style="padding:0 5px;">></span><span style="color:#000000e6">详情</span></div>
7   - </div>
8   - <div style="display: flex;margin-bottom: 10px;">
  2 + <div>
  3 + <div style="display: flex;margin-bottom: 10px;">
9 4 <div v-for="item in typelist" style="width: 30%;margin-right: 3%;text-align: center;padding: 20px 0;border-radius: 3px;border: 2px solid #eee;">
10 5 <div style="font-size: 14px;color: #a8abb2;">{{item.type}}</div>
11 6 <div style="font-size: 22px;margin-top: 10px;color: rgb(63, 155, 106);">{{item.num}}</div>
... ... @@ -80,18 +75,13 @@
80 75 @current-change="handleCurrentChange">
81 76 </el-pagination>
82 77 </div>
83   - <div style="display: flex;">
84   - <router-link to="/other/capitalpoolinfo"> <el-button class="buttonHover" style="color: #606266;border: 1px solid #dddfe5;background-color: #fff;" >返回</el-button></router-link>
85   - </div>
86 78 </div>
87   - </div>
88   - </div>
89 79  
90 80 </div>
91 81 </template>
92 82  
93 83 <script>
94   - import { myCoupons}from '@/api/couponmanagement/couponlist.js'
  84 + import { myCoupons,couponStatistics}from '@/api/couponmanagement/couponlist.js'
95 85 import router from '@/router';
96 86 import coupon from './coupon.vue';
97 87  
... ... @@ -137,20 +127,29 @@
137 127 }
138 128 },
139 129 created () {
140   - this.getAll()
  130 + // this.getAll()
141 131 },
142 132 methods: {
  133 + int(e) {
  134 + this.fundPoolId = e
  135 + couponStatistics({id:this.fundPoolId}).then(res=>{
  136 + console.error(res)
  137 + })
  138 + // this.clear()
  139 + },
143 140 handleClick(tab, event) {
144 141 console.log(tab, event);
145 142 },
146 143 xq(e) {
147 144 // 跳转路由
148   - router.push({
149   - path: '/other/coupon',
150   - query: {
151   - id: e.id
152   - }
153   - })
  145 + // router.push({
  146 + // path: '/other/coupon',
  147 + // query: {
  148 + // id: e.id
  149 + // }
  150 + // })
  151 + console.error(e.id)
  152 + // this.$emit('changecapitalpoolid',e.id)
154 153 },
155 154 async getAll () {
156 155 const res = await myCoupons(this.query)
... ...
admin-web-master/src/views/couponmanagement/couponlist.vue
1 1 <template>
2 2 <div style="background-color:#f7f7f7;padding:10px 10px;">
3   - <div class="couponPage" v-show="type == '1'">
  3 + <div class="couponPage" v-if="type == '1'">
4 4 <div>
5 5 <div style="height:58px;line-height:58px;">
6 6 <div style="color:#0006"> <span>优惠券管理</span> <span style="padding:0 5px;">></span> <span style="color:#000000e6">优惠券列表</span></div>
... ... @@ -42,7 +42,7 @@
42 42 </el-table-column>
43 43 <el-table-column label="优惠内容">
44 44 <template slot-scope="scope">
45   - <span v-if="scope.row.couponType == '1'">满{{ scope.row.maxDiscountAmount }}减{{ scope.row.discountContent }}</span>
  45 + <span v-if="scope.row.couponType == '1'">满{{ scope.row.usageThreshold }}减{{ scope.row.discountContent }}</span>
46 46 <span v-else-if="scope.row.couponType == '2'">{{ scope.row.discountContent }}折 最高减{{ scope.row.maxDiscountAmount }}</span>
47 47 </template>
48 48 </el-table-column>
... ... @@ -64,7 +64,7 @@
64 64 <div style="display: flex;justify-content: space-between;" class="bom">
65 65 <div style="font-size: 14px;">共 <span style="color: #3F9B6A;">{{total}}</span> 项数据</div>
66 66 <el-pagination
67   - :current-page="query.pageNumber"
  67 + :current-page="query.pageNumber+1"
68 68 :page-sizes="[10, 20, 50, 100]"
69 69 :page-size="10"
70 70 background
... ... @@ -78,7 +78,16 @@
78 78 </div>
79 79 </div>
80 80 </div>
81   -
  81 + <div class="couponPage" v-show="type == '3'">
  82 + <div style="height:58px;line-height:58px;">
  83 + <div style="color:#0006"> <span>优惠券管理</span> <span style="padding:0 5px;">></span> <span
  84 + style="color:#000000e6">详情</span></div>
  85 + </div>
  86 + <allinfo ref="allinforef" :type="typeinfo" @changetypeinfo="changetypeinfo" />
  87 + <div style="display: flex;">
  88 + <el-button @click="changetype()" class="buttonHover" style="color: #606266;border: 1px solid #dddfe5;background-color: #fff;" >返回</el-button>
  89 + </div>
  90 + </div>
82 91 </div>
83 92 </template>
84 93  
... ... @@ -86,14 +95,15 @@
86 95 import { getcereFundsPoolData,addcereFundsPool,delPool,editPool,batchGenerateCoupons}from '@/api/couponmanagement/couponlist.js'
87 96 import router from '@/router';
88 97 import coupon from './coupon.vue';
89   -
  98 + import allinfo from './allinfo.vue';
90 99 export default {
91 100  
92 101 components:{
93   - coupon
  102 + coupon,allinfo
94 103 },
95 104 data () {
96 105 return {
  106 + typeinfo:'2',
97 107 couponfrom:{
98 108 usedMerchants:'1',
99 109 couponName: '',
... ... @@ -117,7 +127,7 @@
117 127 activityName: '', // 活动名称
118 128 // 活动状态 0-报名未开始 1-报名进行中 2-活动待开始 3-活动进行中 4-活动已结束
119 129 state: '',
120   - pageNumber: 1,
  130 + pageNumber: 0,
121 131 pageSize: 10
122 132 },
123 133 total: 0,
... ... @@ -153,14 +163,23 @@
153 163 this.getAll()
154 164 },
155 165 methods: {
  166 + changetype() {
  167 + this.type = 1
  168 + },
  169 + changetypeinfo(e) {
  170 + this.typeinfo = e
  171 + },
156 172 xq(e) {
157   - // 跳转路由
158   - router.push({
159   - path: '/other/coupon',
160   - query: {
161   - id: e.id
162   - }
163   - })
  173 + console.log(e )
  174 + this.type = '3'
  175 + this.$refs.allinforef.int(e.id)
  176 + // // 跳转路由
  177 + // router.push({
  178 + // path: '/other/coupon',
  179 + // query: {
  180 + // id: e.id
  181 + // }
  182 + // })
164 183 },
165 184 addcoupon(e) {
166 185 let that = this
... ... @@ -191,19 +210,19 @@
191 210 const res = await getcereFundsPoolData(this.query)
192 211 console.error(res.data.content)
193 212 this.tableData = res.data.content
194   - this.total = res.data.numberOfElements
  213 + this.total = res.data.totalElements
195 214 },
196 215 handleSizeChange (val) {
197 216 this.query.pageSize = val
198 217 this.getAll()
199 218 },
200 219 handleCurrentChange (val) {
201   - this.query.pageNumber = val
  220 + this.query.pageNumber = val-1
202 221 this.getAll()
203 222 },
204 223 search () {
205 224 this.total = 1
206   - this.query.pageNumber = 1
  225 + this.query.pageNumber = 0
207 226 this.getAll()
208 227 },
209 228 // 重置
... ... @@ -211,7 +230,7 @@
211 230 this.query = {
212 231 activityName: '',
213 232 state: '',
214   - pageNumber: 1,
  233 + pageNumber: 0,
215 234 pageSize: 10
216 235 }
217 236 this.getAll()
... ...
ceres-uniapp-master/components/goodsDetalils/coupon-popup.vue
... ... @@ -16,7 +16,7 @@
16 16 @change="activeTypeActive"
17 17 ></u-tabs>
18 18 </view>
19   - <view v-show="activeTypeFlag === 0">
  19 + <view v-show="activeTypeFlag === 1">
20 20 <view class="couponShow">
21 21 <view class="title-box">
22 22 <image class="close-btn" @click="onActivityClose" src="https://jy.scjysm.asia:18086/mefile/file/static/images/close.png"></image>
... ... @@ -52,7 +52,7 @@
52 52 </view>
53 53 </view>
54 54 </view>
55   - <view v-show="activeTypeFlag === 1">
  55 + <view v-show="activeTypeFlag === 0">
56 56 <view class="couponShow">
57 57 <view class="title-box">
58 58 <image class="close-btn" @click="onActivityClose" src="https://jy.scjysm.asia:18086/mefile/file/static/images/close.png"></image>
... ... @@ -134,9 +134,11 @@ export default {
134 134 // activeTypeList: [ {
135 135 // name: '店铺活动'
136 136 // }]
137   - activeTypeList: [{
138   - name: '平台活动'
139   - }, {
  137 + activeTypeList: [
  138 + // {
  139 + // name: '平台活动'
  140 + // },
  141 + {
140 142 name: '店铺活动'
141 143 }],
142 144 }
... ...
ceres-uniapp-master/config/api.js
... ... @@ -7,8 +7,7 @@
7 7 // const DOMAIN_PREFIX = 'http://172.16.61.126:8080/meserver/api'
8 8 // const DOMAIN_PREFIXPING = 'http://172.16.61.126:8080/meserver/admin-server'
9 9 // const DOMAIN_PREFIX = 'http://172.16.61.126:8080/meserver/api'
10   -const DOMAIN_PREFIXPING = 'https://jy.scjysm.asia:18086/meserver/admin-server'
11   -const DOMAIN_PREFIX = 'https://jy.scjysm.asia:18086/meserver/api'
  10 +
12 11 // const DOMAIN_PREFIXPING = 'https://wjdc.scjysm.asia:1443/meserver/admin-server'
13 12 // const DOMAIN_PREFIX = 'https://wjdc.scjysm.asia:1443/meserver/api'
14 13 // const DOMAIN_PREFIXPING = 'https://zhld.028wlkj.com:1443/meserver/admin-server'
... ... @@ -21,6 +20,14 @@ const DOMAIN_PREFIX = &#39;https://jy.scjysm.asia:18086/meserver/api&#39;
21 20 // const DOMAIN_PREFIX = 'http://172.16.61.48/meserver/api'
22 21 //const DOMAIN_PREFIX = 'http://192.168.2.61:9007'
23 22  
  23 +const DOMAIN_PREFIXPING = 'https://jy.scjysm.asia:18086/meserver/admin-server'
  24 +const DOMAIN_PREFIX = 'https://jy.scjysm.asia:18086/meserver/api'
  25 +
  26 +// const DOMAIN_PREFIXPING = 'http://8.130.38.56:9007'
  27 +// const DOMAIN_PREFIX = 'http://8.130.38.56:9007'
  28 +
  29 +// const DOMAIN_PREFIXPING = 'http://8.130.38.56:9003'
  30 +// const DOMAIN_PREFIX = 'http://8.130.38.56:9003'
24 31 // #ifndef H5
25 32 const WX_API_BASE = DOMAIN_PREFIX // app
26 33 const WX_API_BASEPING = DOMAIN_PREFIXPING // app
... ... @@ -315,4 +322,10 @@ module.exports = {
315 322 wenjuanUp: WX_API_BASE + '/cereQuestionnaireAnswering/add',
316 323 //新优惠券
317 324 couponnew: 'http://8.130.38.56:9007/coupon/myCoupons',
  325 + //商家优惠券
  326 + cereCouponMainTablequeryByPage: 'http://8.130.38.56:9003/cereCouponMainTable/queryByPage',
  327 + //领取商家优惠券
  328 + receiveCoupons: 'http://8.130.38.56:9007/coupon/receiveCoupons',
  329 + //获取订单的优惠券
  330 + cereCouponKeyUse: 'http://8.130.38.56:9007/order/cereCouponKeyUse',
318 331 }
... ...
ceres-uniapp-master/pages/tabbar/category/index.vue
... ... @@ -53,14 +53,14 @@
53 53  
54 54 <view style="display: flex; width: 100%;flex-wrap: wrap;">
55 55 <view v-for="(groupItem,groupIndex) in AllList[val]"
56   - style="margin-bottom: 20rpx;padding: 20rpx 10rpx 0rpx 10rpx;max-width: 153px;"
  56 + style="margin-bottom: 20rpx;padding: 20rpx 10rpx 0rpx 10rpx;width: 49%;"
57 57 @click="goodsDateils(groupItem.shopId,groupItem.productId,groupItem.skuId)">
58 58  
59 59 <view>
60 60 <image :src="groupItem.image" mode=""
61 61 style="width:240rpx;height: 240rpx;margin-right: 10rpx;border-radius: 10rpx;">
62 62 </image>
63   - <view class="tableTitle">{{groupItem.productName}}</view>
  63 + <view class="tableTitle" style="-webkit-line-clamp: 1;display: -webkit-box;-webkit-box-orient: vertical;overflow: hidden;text-overflow: ellipsis;">{{groupItem.productName}}</view>
64 64 <view class="tableText"><text
65 65 style="color: #C44A51;font-weight: 700;">{{groupItem.price}} ¥</text> <text
66 66 style="color: #A9A9A9;">已售 {{groupItem.number}}件</text> </view>
... ... @@ -487,17 +487,9 @@
487 487  
488 488 .tableTitle {
489 489 font-size: 28rpx;
490   - padding-left: 4rpx;
491   - overflow: hidden;
492   - text-overflow: ellipsis;
493   - display: -webkit-box;
494   - /* -webkit-line-clamp: 2; */
495   - -webkit-box-orient: vertical;
496   - padding: 10rpx 10rpx;
497   - word-wrap: break-word; /* 兼容旧版浏览器 */
498   - overflow-wrap: break-word; /* 标准属性 */
499   - white-space: pre-wrap; /* 保留空白符序列,但是正常地进行换行 */
500   - max-width: 100%; /* 确保文本容器有最大宽度限制 */
  490 + padding: 0 4rpx;
  491 + margin: 10rpx 0;
  492 + max-width: 100%; /* 确保文本容器有最大宽度限制 */
501 493 }
502 494  
503 495 .tableText {
... ...
ceres-uniapp-master/pages_category_page1/coupon/1.vue renamed to ceres-uniapp-master/pages_category_page1/coupon/22.vue
1 1 <template>
2   - <view class="couponList u-skeleton">
3   - <Skeleton
4   - el-color="#efefef"
5   - bg-color="#fff"
6   - :loading="loading && isFirstComeIn"
7   - :animation="true"
8   - />
9   - <template v-if="couponList.length>0">
10   - <view
11   - class="couponItem u-skeleton-fillet flex-items"
12   - v-for="item of couponList"
13   - :key="item.couponId"
14   - >
15   - <view
16   - class="itemLeft u-skeleton-fillet"
17   - @click="goProductList(item)"
18   - >
19   - <view class="topIcon"></view>
20   - <view class="bottomIcon"></view>
21   - <view class="price flex-items">
22   - <view
23   - class="flex-column flex-end unitBox"
24   - v-if="item.discountMode === 1"
25   - >
26   - <view class="unit">¥</view>
27   - </view>
28   - <view class="priceValue">{{ item.reduceMoney }}{{ item.discountMode === 1 ? '' : '折' }}</view>
29   - </view>
30   - <text class="fs24 font-color-999">满{{ item.fullMoney }}元可用</text>
31   - </view>
32   - <view class="itemRight u-skeleton-fillet">
33   - <view class="topInfo flex-items flex-sp-between">
34   - <view @click="goProductList(item)">
35   - <view class="couponTit fs32 font-color-FFF">{{ item.activityName }}</view>
36   - <view class="couponDate fs24 font-color-999">{{ item.endTime }}到期</view>
37   - </view>
38   - <view class="exchangeBtnBox flex-column flex-end">
39   - <view
40   - class="exchangeBtn fs24 font-color-FFF"
41   - v-if="item.state === 0"
42   - >已领取
43   - </view>
44   - <wx-send-coupon
45   - v-else
46   - @success="success"
47   - :couponList="[item]"
48   - >
49   - <view class="exchangeBtn fs24 font-color-FFF">{{ item.ifCredit ? '立即兑换' : '立即领取' }}</view>
50   - </wx-send-coupon>
51   - </view>
52   - </view>
53   - <view
54   - @click="goProductList(item)"
55   - class="couponType fs28 font-color-FFF"
56   - >{{ item.discountMode === 1 ? '满减券' : '折扣券' }}
57   - </view>
58   - </view>
59   - </view>
60   - <!-- 触底 -->
61   - <view
62   - class="reachBottom"
63   - v-if="topLeft > 400 && couponList.length>0"
64   - >
65   - <image
66   - class="reach-icon"
67   - src="https://jy.scjysm.asia:18086/mefile/file/static/img//reachBottom.png"
68   - mode="widthFix"
69   - ></image>
70   - <text class="reach-text">这里到底了哦~~</text>
71   - </view>
72   - </template>
73   - <Empty :show="couponList.length<=0" />
74   - </view>
  2 + <view class="couponList u-skeleton">
  3 + <Skeleton el-color="#efefef" bg-color="#fff" :loading="loading && isFirstComeIn" :animation="true" />
  4 + <template v-if="couponList.length>0">
  5 + <view class="couponItem u-skeleton-fillet flex-items" v-for="item of couponList" :key="item.couponId">
  6 + <view class="itemLeft u-skeleton-fillet" @click="goProductList(item)">
  7 + <view class="topIcon"></view>
  8 + <view class="bottomIcon"></view>
  9 + <view class="price flex-items">
  10 + <view class="flex-column flex-end unitBox" v-if="item.discountMode === 1">
  11 + <view class="unit">¥</view>
  12 + </view>
  13 + <view class="priceValue">{{ item.reduceMoney }}{{ item.discountMode === 1 ? '' : '折' }}</view>
  14 + </view>
  15 + <text class="fs24 font-color-999">满{{ item.fullMoney }}元可用</text>
  16 + </view>
  17 + <view class="itemRight u-skeleton-fillet">
  18 + <view class="topInfo flex-items flex-sp-between">
  19 + <view @click="goProductList(item)">
  20 + <view class="couponTit fs32 font-color-FFF">{{ item.activityName }}</view>
  21 + <view class="couponDate fs24 font-color-999">{{ item.endTime }}到期</view>
  22 + </view>
  23 + <view class="exchangeBtnBox flex-column flex-end">
  24 + <view class="exchangeBtn fs24 font-color-FFF" v-if="item.state === 0">已领取
  25 + </view>
  26 + <wx-send-coupon v-else @success="success" :couponList="[item]">
  27 + <view class="exchangeBtn fs24 font-color-FFF">{{ item.ifCredit ? '立即兑换' : '立即领取' }}
  28 + </view>
  29 + </wx-send-coupon>
  30 + </view>
  31 + </view>
  32 + <view @click="goProductList(item)" class="couponType fs28 font-color-FFF">
  33 + {{ item.discountMode === 1 ? '满减券' : '折扣券' }}
  34 + </view>
  35 + </view>
  36 + </view>
  37 + <!-- 触底 -->
  38 + <view class="reachBottom" v-if="topLeft > 400 && couponList.length>0">
  39 + <image class="reach-icon" src="https://jy.scjysm.asia:18086/mefile/file/static/img//reachBottom.png"
  40 + mode="widthFix"></image>
  41 + <text class="reach-text">这里到底了哦~~</text>
  42 + </view>
  43 + </template>
  44 + <Empty :show="couponList.length<=0" />
  45 + </view>
75 46 </template>
76 47  
77 48 <script>
78   -import Skeleton from "../../components/Skeleton";
79   -import Empty from "../../components/Empty";
80   -import WxSendCoupon from "../../components/wx/wxSendCoupon";
  49 + import Skeleton from "../../components/Skeleton";
  50 + import Empty from "../../components/Empty";
  51 + import WxSendCoupon from "../../components/wx/wxSendCoupon";
81 52  
82   -const NET = require('../../utils/request')
83   -const API = require('../../config/api')
84   -export default {
85   - name: "list",
86   - components: {WxSendCoupon, Empty, Skeleton},
87   - data() {
88   - return {
89   - loading: false,
90   - isFirstComeIn: true,
91   - couponList: [{}, {}, {}, {}, {}, {}], // 优惠券列表getCoupons
92   - page: 1,
93   - pageSize: 10,
94   - loadingType: 0,
95   - topLeft: 0
96   - }
97   - },
98   - onLoad() {
99   - this.getCouponList()
100   - },
101   - onReachBottom() {
102   - if (this.loadingType == 1) {
103   - uni.stopPullDownRefresh()
104   - } else {
105   - this.page = this.page + 1
106   - this.getCouponList()
107   - }
108   - },
109   - onPageScroll(e) {
110   - this.topLeft = e.scrollTop
111   - },
112   - methods: {
113   - getCouponList() {
114   - // uni.showLoading({
115   - // mask: true,
116   - // title: '加载中...'
117   - // })
118   - this.loading = true
119   - NET.request(API.couponnew, {
120   - page: this.page,
121   - pageSize: this.pageSize,
122   - shopId:154
123   - }, 'POST').then(res => {
124   - uni.hideLoading()
125   - if (res.data.length === 0) {
126   - this.loadingType = 1
127   - } else {
128   - this.couponList = this.couponList.concat(res.data)
129   - this.$forceUpdate()
130   - }
131   - this.couponList = this.couponList.filter(item => JSON.stringify(item) !== '{}')
132   - this.loading = false
133   - this.isFirstComeIn = false
134   - }).catch(res => {
135   - uni.hideLoading()
136   - })
137   - // NET.request(API.getCoupons, {
138   - // page: this.page,
139   - // pageSize: this.pageSize
140   - // }, 'GET').then(res => {
141   - // uni.hideLoading()
142   - // if (res.data.list.length === 0) {
143   - // this.loadingType = 1
144   - // } else {
145   - // this.couponList = this.couponList.concat(res.data.list)
146   - // this.$forceUpdate()
147   - // }
148   - // this.couponList = this.couponList.filter(item => JSON.stringify(item) !== '{}')
149   - // this.loading = false
150   - // this.isFirstComeIn = false
151   - // }).catch(res => {
152   - // uni.hideLoading()
153   - // })
154   - },
155   - // 跳转到可用商品列表
156   - goProductList(item) {
157   - console.log(item, 'test')
158   - uni.navigateTo({
159   - url: `../coupon/product?id=${ item.couponId }&actId=${item.activityId}`
160   - })
161   - },
162   - success() {
163   - this.page = 1
164   - this.couponList = []
165   - this.getCouponList()
166   - }
167   - }
168   -}
  53 + const NET = require('../../utils/request')
  54 + const API = require('../../config/api')
  55 + export default {
  56 + name: "list",
  57 + components: {
  58 + WxSendCoupon,
  59 + Empty,
  60 + Skeleton
  61 + },
  62 + data() {
  63 + return {
  64 + loading: false,
  65 + isFirstComeIn: true,
  66 + couponList: [{}, {}, {}, {}, {}, {}], // 优惠券列表getCoupons
  67 + page: 1,
  68 + pageSize: 10,
  69 + loadingType: 0,
  70 + topLeft: 0
  71 + }
  72 + },
  73 + onLoad() {
  74 + this.getCouponList()
  75 + },
  76 + onReachBottom() {
  77 + if (this.loadingType == 1) {
  78 + uni.stopPullDownRefresh()
  79 + } else {
  80 + this.page = this.page + 1
  81 + this.getCouponList()
  82 + }
  83 + },
  84 + onPageScroll(e) {
  85 + this.topLeft = e.scrollTop
  86 + },
  87 + methods: {
  88 + getCouponList() {
  89 + // uni.showLoading({
  90 + // mask: true,
  91 + // title: '加载中...'
  92 + // })
  93 + this.loading = true
  94 + NET.request(API.youhuiquan, {
  95 + page: this.page,
  96 + pageSize: this.pageSize,
  97 + shopId: 154
  98 + }, 'GET').then(res => {
  99 + uni.hideLoading()
  100 + if (res.data.length === 0) {
  101 + this.loadingType = 1
  102 + } else {
  103 + this.couponList = this.couponList.concat(res.data)
  104 + this.$forceUpdate()
  105 + }
  106 + this.couponList = this.couponList.filter(item => JSON.stringify(item) !== '{}')
  107 + this.loading = false
  108 + this.isFirstComeIn = false
  109 + }).catch(res => {
  110 + uni.hideLoading()
  111 + })
  112 + // NET.request(API.getCoupons, {
  113 + // page: this.page,
  114 + // pageSize: this.pageSize
  115 + // }, 'GET').then(res => {
  116 + // uni.hideLoading()
  117 + // if (res.data.list.length === 0) {
  118 + // this.loadingType = 1
  119 + // } else {
  120 + // this.couponList = this.couponList.concat(res.data.list)
  121 + // this.$forceUpdate()
  122 + // }
  123 + // this.couponList = this.couponList.filter(item => JSON.stringify(item) !== '{}')
  124 + // this.loading = false
  125 + // this.isFirstComeIn = false
  126 + // }).catch(res => {
  127 + // uni.hideLoading()
  128 + // })
  129 + },
  130 + // 跳转到可用商品列表
  131 + goProductList(item) {
  132 + console.log(item, 'test')
  133 + uni.navigateTo({
  134 + url: `../coupon/product?id=${ item.couponId }&actId=${item.activityId}`
  135 + })
  136 + },
  137 + success() {
  138 + this.page = 1
  139 + this.couponList = []
  140 + this.getCouponList()
  141 + }
  142 + }
  143 + }
169 144 </script>
170 145  
171   -<style
172   - lang="scss"
173   - scoped
174   ->
175   -page {
176   - background: #F8F8F8;
  146 +<style lang="scss" scoped>
  147 + page {
  148 + background: #F8F8F8;
177 149  
178   - .couponList {
179   - padding: 0 20rpx 40upx;
180   - margin-top: 30rpx;
  150 + .couponList {
  151 + padding: 0 20rpx 40upx;
  152 + margin-top: 30rpx;
181 153  
182   - .couponItem {
183   - background: #333333;
184   - margin-top: 40rpx;
185   - padding: 25rpx 35rpx;
186   - overflow: hidden;
187   - background-image: url("https://jy.scjysm.asia:18086/mefile/file/static/images/borderIcon.png");
188   - background-repeat: no-repeat;
189   - background-size: contain;
190   - background-position: right top;
  154 + .couponItem {
  155 + background: #333333;
  156 + margin-top: 40rpx;
  157 + padding: 25rpx 35rpx;
  158 + overflow: hidden;
  159 + background-image: url("https://jy.scjysm.asia:18086/mefile/file/static/images/borderIcon.png");
  160 + background-repeat: no-repeat;
  161 + background-size: contain;
  162 + background-position: right top;
191 163  
192   - .itemLeft {
193   - padding-right: 10rpx;
194   - position: relative;
195   - border-right: 2rpx dashed #666666;
196   - width: 170rpx;
  164 + .itemLeft {
  165 + padding-right: 10rpx;
  166 + position: relative;
  167 + border-right: 2rpx dashed #666666;
  168 + width: 170rpx;
197 169  
198   - .topIcon {
199   - position: absolute;
200   - right: -16rpx;
201   - top: -50rpx;
202   - width: 32rpx;
203   - height: 32rpx;
204   - background: #FFFFFF;
205   - border-radius: 50%;
206   - }
  170 + .topIcon {
  171 + position: absolute;
  172 + right: -16rpx;
  173 + top: -50rpx;
  174 + width: 32rpx;
  175 + height: 32rpx;
  176 + background: #FFFFFF;
  177 + border-radius: 50%;
  178 + }
207 179  
208   - .bottomIcon {
209   - position: absolute;
210   - right: -16rpx;
211   - bottom: -50rpx;
212   - width: 32rpx;
213   - height: 32rpx;
214   - background: #FFFFFF;
215   - border-radius: 50%;
216   - }
  180 + .bottomIcon {
  181 + position: absolute;
  182 + right: -16rpx;
  183 + bottom: -50rpx;
  184 + width: 32rpx;
  185 + height: 32rpx;
  186 + background: #FFFFFF;
  187 + border-radius: 50%;
  188 + }
217 189  
218   - //.price {
219   - // width: 100rpx;
220   - //}
221   - .unitBox {
222   - height: 70rpx;
223   - }
  190 + //.price {
  191 + // width: 100rpx;
  192 + //}
  193 + .unitBox {
  194 + height: 70rpx;
  195 + }
224 196  
225   - .unit {
226   - color: #FFEBC4;
227   - font-size: 36rpx;
228   - }
  197 + .unit {
  198 + color: #FFEBC4;
  199 + font-size: 36rpx;
  200 + }
229 201  
230   - .priceValue {
231   - font-size: 52rpx;
232   - color: #FFEBC4;
233   - }
234   - }
  202 + .priceValue {
  203 + font-size: 52rpx;
  204 + color: #FFEBC4;
  205 + }
  206 + }
235 207  
236   - .itemRight {
237   - padding-left: 45rpx;
238   - flex: 1;
  208 + .itemRight {
  209 + padding-left: 45rpx;
  210 + flex: 1;
239 211  
240   - .topInfo {
241   - padding-bottom: 10rpx;
242   - border-bottom: 2rpx solid #444444;
243   - margin-bottom: 10rpx;
  212 + .topInfo {
  213 + padding-bottom: 10rpx;
  214 + border-bottom: 2rpx solid #444444;
  215 + margin-bottom: 10rpx;
244 216  
245   - .couponDate {
246   - width: 300rpx;
247   - }
  217 + .couponDate {
  218 + width: 300rpx;
  219 + }
248 220  
249   - .exchangeBtnBox {
250   - width: 110rpx;
251   - height: 70rpx;
252   - text-align: center;
  221 + .exchangeBtnBox {
  222 + width: 110rpx;
  223 + height: 70rpx;
  224 + text-align: center;
253 225  
254   - .exchangeBtn {
255   - padding: 5rpx;
256   - border: 2rpx solid #999999;
257   - }
258   - }
259   - }
260   - }
261   - }
262   - }
  226 + .exchangeBtn {
  227 + padding: 5rpx;
  228 + border: 2rpx solid #999999;
  229 + }
  230 + }
  231 + }
  232 + }
  233 + }
  234 + }
263 235  
264   - .Put-box1 {
265   - .btn {
266   - text-align: center;
267   - margin-top: 40rpx;
268   - border: 2rpx solid #333333;
269   - height: 80upx;
270   - line-height: 80upx;
271   - width: 100%;
272   - color: #333333;
273   - }
  236 + .Put-box1 {
  237 + .btn {
  238 + text-align: center;
  239 + margin-top: 40rpx;
  240 + border: 2rpx solid #333333;
  241 + height: 80upx;
  242 + line-height: 80upx;
  243 + width: 100%;
  244 + color: #333333;
  245 + }
274 246  
275   - .submit {
276   - background-color: #333333;
277   - color: #FFEBC4;
278   - margin-left: 20rpx;
279   - }
280   - }
281   -}
  247 + .submit {
  248 + background-color: #333333;
  249 + color: #FFEBC4;
  250 + margin-left: 20rpx;
  251 + }
  252 + }
  253 + }
282 254  
283   -// 触底样式
284   -.reachBottom {
285   - margin-top: 30rpx;
286   - display: flex;
287   - flex-direction: column;
288   - align-items: center;
  255 + // 触底样式
  256 + .reachBottom {
  257 + margin-top: 30rpx;
  258 + display: flex;
  259 + flex-direction: column;
  260 + align-items: center;
289 261  
290   - .reach-icon {
291   - width: 150rpx;
292   - height: 150rpx;
293   - }
  262 + .reach-icon {
  263 + width: 150rpx;
  264 + height: 150rpx;
  265 + }
294 266  
295   - .reach-text {
296   - margin: 20rpx 0;
297   - color: #CCCCCC;
298   - }
299   -}
300   -</style>
  267 + .reach-text {
  268 + margin: 20rpx 0;
  269 + color: #CCCCCC;
  270 + }
  271 + }
  272 +</style>
301 273 \ No newline at end of file
... ...
ceres-uniapp-master/pages_category_page1/coupon/list.vue
1 1 <template>
2   - <view class="couponList u-skeleton">
3   - <Skeleton
4   - el-color="#efefef"
5   - bg-color="#fff"
6   - :loading="loading && isFirstComeIn"
7   - :animation="true"
8   - />
9   - <template v-if="couponList.length>0">
10   - <view
11   - class="couponItem u-skeleton-fillet flex-items"
12   - v-for="item of couponList"
13   - :key="item.couponId"
14   - >
15   - <view
16   - class="itemLeft u-skeleton-fillet"
17   - @click="goProductList(item)"
18   - >
19   - <view class="topIcon"></view>
20   - <view class="bottomIcon"></view>
21   - <view class="price flex-items">
22   - <view
23   - class="flex-column flex-end unitBox"
24   - v-if="item.discountMode === 1"
25   - >
26   - <view class="unit">¥</view>
27   - </view>
28   - <view class="priceValue">{{ item.reduceMoney }}{{ item.discountMode === 1 ? '' : '折' }}</view>
29   - </view>
30   - <text class="fs24 font-color-999">满{{ item.fullMoney }}元可用</text>
31   - </view>
32   - <view class="itemRight u-skeleton-fillet">
33   - <view class="topInfo flex-items flex-sp-between">
34   - <view @click="goProductList(item)">
35   - <view class="couponTit fs32 font-color-FFF">{{ item.activityName }}</view>
36   - <view class="couponDate fs24 font-color-999">{{ item.endTime }}到期</view>
37   - </view>
38   - <view class="exchangeBtnBox flex-column flex-end">
39   - <view
40   - class="exchangeBtn fs24 font-color-FFF"
41   - v-if="item.state === 0"
42   - >已领取
43   - </view>
44   - <wx-send-coupon
45   - v-else
46   - @success="success"
47   - :couponList="[item]"
48   - >
49   - <view class="exchangeBtn fs24 font-color-FFF">{{ item.ifCredit ? '立即兑换' : '立即领取' }}</view>
50   - </wx-send-coupon>
51   - </view>
52   - </view>
53   - <view
54   - @click="goProductList(item)"
55   - class="couponType fs28 font-color-FFF"
56   - >{{ item.discountMode === 1 ? '满减券' : '折扣券' }}
57   - </view>
58   - </view>
59   - </view>
60   - <!-- 触底 -->
61   - <view
62   - class="reachBottom"
63   - v-if="topLeft > 400 && couponList.length>0"
64   - >
65   - <image
66   - class="reach-icon"
67   - src="https://jy.scjysm.asia:18086/mefile/file/static/img//reachBottom.png"
68   - mode="widthFix"
69   - ></image>
70   - <text class="reach-text">这里到底了哦~~</text>
71   - </view>
72   - </template>
73   - <Empty :show="couponList.length<=0" />
74   - </view>
  2 + <view class="couponList u-skeleton">
  3 + <Skeleton el-color="#efefef" bg-color="#fff" :loading="loading && isFirstComeIn" :animation="true" />
  4 + <view class="tabs-nav-warp">
  5 + <scroll-view class="tabs-nav" scroll-x="true">
  6 + <view class="ul">
  7 + <view class="li" :class="{'on':activeTab==='1'}" @click="tabChange('1')">平台优惠券</view>
  8 + <view class="li" :class="{'on':activeTab==='2'}" @click="tabChange('2')">商家优惠券</view>
  9 + </view>
  10 + </scroll-view>
  11 + </view>
  12 + <template v-if="couponList.length>0">
  13 + <view v-for="item of couponList" :key="item.couponId">
  14 + <view class="couponItem u-skeleton-fillet flex-items" v-if="activeTab == '1'">
  15 + <view class="itemLeft u-skeleton-fillet" >
  16 + <view class="topIcon"></view>
  17 + <view class="bottomIcon"></view>
  18 + <view class="price flex-items">
  19 + <view class="flex-column flex-end unitBox" v-if="item.couponType == '1'">
  20 + <view class="unit">¥</view>
  21 + </view>
  22 + <view class="priceValue">{{item.couponType == '1'?item.discountContent:item.discountContent+'折' }}</view>
  23 + </view>
  24 + <text class="fs24 font-color-999">{{item.couponType == '1'?'满'+item.maxDiscountAmount+'元可用':'最高'+item.maxDiscountAmount+'元'}}</text>
  25 + </view>
  26 + <view class="itemRight u-skeleton-fillet">
  27 + <view class="topInfo flex-items flex-sp-between">
  28 + <view >
  29 + <view class="couponDate fs24 font-color-999">{{ item.endTime }}到期</view>
  30 + </view>
  31 + </view>
  32 + <view class="couponType fs28 font-color-FFF">
  33 + {{ item.couponType == '1' ? '满减券' : '折扣券' }}
  34 + </view>
  35 + </view>
  36 + </view>
  37 + <view class="couponItem u-skeleton-fillet flex-items" v-else>
  38 + <view class="itemLeft u-skeleton-fillet" @click="goProductList(item)">
  39 + <view class="topIcon"></view>
  40 + <view class="bottomIcon"></view>
  41 + <view class="price flex-items">
  42 + <view class="flex-column flex-end unitBox" v-if="item.discountMode === 1">
  43 + <view class="unit">¥</view>
  44 + </view>
  45 + <view class="priceValue">{{ item.reduceMoney }}{{ item.discountMode === 1 ? '' : '折' }}</view>
  46 + </view>
  47 + <text class="fs24 font-color-999">满{{ item.fullMoney }}元可用</text>
  48 + </view>
  49 + <view class="itemRight u-skeleton-fillet">
  50 + <view class="topInfo flex-items flex-sp-between">
  51 + <view @click="goProductList(item)">
  52 + <view class="couponTit fs32 font-color-FFF">{{ item.activityName }}</view>
  53 + <view class="couponDate fs24 font-color-999">{{ item.endTime }}到期</view>
  54 + </view>
  55 + <view class="exchangeBtnBox flex-column flex-end">
  56 + <view class="exchangeBtn fs24 font-color-FFF" v-if="item.state === 0">已领取
  57 + </view>
  58 + <wx-send-coupon v-else @success="success" :couponList="[item]">
  59 + <view class="exchangeBtn fs24 font-color-FFF">{{ item.ifCredit ? '立即兑换' : '立即领取' }}
  60 + </view>
  61 + </wx-send-coupon>
  62 + </view>
  63 + </view>
  64 + <view @click="goProductList(item)" class="couponType fs28 font-color-FFF">
  65 + {{ item.discountMode === 1 ? '满减券' : '折扣券' }}
  66 + </view>
  67 + </view>
  68 + </view>
  69 + </view>
  70 +
  71 + <!-- 触底 -->
  72 + <view class="reachBottom" v-if="topLeft > 400 && couponList.length>0">
  73 + <image class="reach-icon" src="https://jy.scjysm.asia:18086/mefile/file/static/img//reachBottom.png"
  74 + mode="widthFix"></image>
  75 + <text class="reach-text">这里到底了哦~~</text>
  76 + </view>
  77 + </template>
  78 + <Empty :show="couponList.length<=0" />
  79 + </view>
75 80 </template>
76 81  
77 82 <script>
78   -import Skeleton from "../../components/Skeleton";
79   -import Empty from "../../components/Empty";
80   -import WxSendCoupon from "../../components/wx/wxSendCoupon";
  83 + import Skeleton from "../../components/Skeleton";
  84 + import Empty from "../../components/Empty";
  85 + import WxSendCoupon from "../../components/wx/wxSendCoupon";
81 86  
82   -const NET = require('../../utils/request')
83   -const API = require('../../config/api')
84   -export default {
85   - name: "list",
86   - components: {WxSendCoupon, Empty, Skeleton},
87   - data() {
88   - return {
89   - loading: false,
90   - isFirstComeIn: true,
91   - couponList: [{}, {}, {}, {}, {}, {}], // 优惠券列表getCoupons
92   - page: 1,
93   - pageSize: 10,
94   - loadingType: 0,
95   - topLeft: 0
96   - }
97   - },
98   - onLoad() {
99   - this.getCouponList()
100   - },
101   - onReachBottom() {
102   - if (this.loadingType == 1) {
103   - uni.stopPullDownRefresh()
104   - } else {
105   - this.page = this.page + 1
106   - this.getCouponList()
107   - }
108   - },
109   - onPageScroll(e) {
110   - this.topLeft = e.scrollTop
111   - },
112   - methods: {
113   - getCouponList() {
114   - // uni.showLoading({
115   - // mask: true,
116   - // title: '加载中...'
117   - // })
118   - this.loading = true
119   - NET.request(API.youhuiquan, {
120   - page: this.page,
121   - pageSize: this.pageSize,
122   - shopId:154
123   - }, 'GET').then(res => {
124   - uni.hideLoading()
125   - if (res.data.length === 0) {
126   - this.loadingType = 1
127   - } else {
128   - this.couponList = this.couponList.concat(res.data)
129   - this.$forceUpdate()
130   - }
131   - this.couponList = this.couponList.filter(item => JSON.stringify(item) !== '{}')
132   - this.loading = false
133   - this.isFirstComeIn = false
134   - }).catch(res => {
135   - uni.hideLoading()
136   - })
137   - // NET.request(API.getCoupons, {
138   - // page: this.page,
139   - // pageSize: this.pageSize
140   - // }, 'GET').then(res => {
141   - // uni.hideLoading()
142   - // if (res.data.list.length === 0) {
143   - // this.loadingType = 1
144   - // } else {
145   - // this.couponList = this.couponList.concat(res.data.list)
146   - // this.$forceUpdate()
147   - // }
148   - // this.couponList = this.couponList.filter(item => JSON.stringify(item) !== '{}')
149   - // this.loading = false
150   - // this.isFirstComeIn = false
151   - // }).catch(res => {
152   - // uni.hideLoading()
153   - // })
154   - },
155   - // 跳转到可用商品列表
156   - goProductList(item) {
157   - console.log(item, 'test')
158   - uni.navigateTo({
159   - url: `../coupon/product?id=${ item.couponId }&actId=${item.activityId}`
160   - })
161   - },
162   - success() {
163   - this.page = 1
164   - this.couponList = []
165   - this.getCouponList()
166   - }
167   - }
168   -}
  87 + const NET = require('../../utils/request')
  88 + const API = require('../../config/api')
  89 + export default {
  90 + name: "list",
  91 + components: {
  92 + WxSendCoupon,
  93 + Empty,
  94 + Skeleton
  95 + },
  96 + data() {
  97 + return {
  98 + activeTab:'1',
  99 + loading: false,
  100 + isFirstComeIn: true,
  101 + couponList: [{}, {}, {}, {}, {}, {}], // 优惠券列表getCoupons
  102 + page: 1,
  103 + pageSize: 10,
  104 + loadingType: 0,
  105 + topLeft: 0
  106 + }
  107 + },
  108 + onLoad() {
  109 + console.error(uni.getStorageSync('storage_key').buyerUserId)
  110 + // NET.request(API.GetUser, {}, 'GET').then(res => {
  111 + // console.log(res.data)
  112 +
  113 + // })
  114 + this.getCouponList()
  115 + },
  116 + onReachBottom() {
  117 + // if (this.loadingType == 1) {
  118 + // uni.stopPullDownRefresh()
  119 + // } else {
  120 + // this.page = this.page + 1
  121 + // this.getCouponList()
  122 + // }
  123 + },
  124 + onPageScroll(e) {
  125 + this.topLeft = e.scrollTop
  126 + },
  127 + methods: {
  128 + // 栏目切换
  129 + tabChange(key) {
  130 + this.activeTab = key
  131 + this.page = 1
  132 + this.couponList = []
  133 + this.getCouponList()
  134 + // if (key !== 'index') {
  135 + // this.page = 1
  136 + // this.classifyId = key === 'all' ? '' : key
  137 + // this.storeInfolist = []
  138 + // this.getTemplate()
  139 + // }
  140 + },
  141 + getCouponList() {
  142 + // uni.showLoading({
  143 + // mask: true,
  144 + // title: '加载中...'
  145 + // })
  146 + this.loading = true
  147 + if(this.activeTab == '1') {
  148 + NET.request(API.couponnew, {
  149 + page: this.page,
  150 + pageSize: this.pageSize,
  151 + userId: uni.getStorageSync('storage_key').buyerUserId
  152 + }, 'POST').then(res => {
  153 + uni.hideLoading()
  154 + if (res.data.length === 0) {
  155 + this.loadingType = 1
  156 + } else {
  157 + this.couponList = this.couponList.concat(res.data)
  158 + this.$forceUpdate()
  159 + }
  160 + this.couponList = this.couponList.filter(item => JSON.stringify(item) !== '{}')
  161 + this.loading = false
  162 + this.isFirstComeIn = false
  163 + console.error(this.couponList)
  164 + }).catch(res => {
  165 + uni.hideLoading()
  166 + })
  167 + } else {
  168 + NET.request(API.getCoupons, {
  169 + page: this.page,
  170 + pageSize: this.pageSize
  171 + }, 'GET').then(res => {
  172 + uni.hideLoading()
  173 + if (res.data.list.length === 0) {
  174 + this.loadingType = 1
  175 + } else {
  176 + this.couponList = this.couponList.concat(res.data.list)
  177 + this.$forceUpdate()
  178 + }
  179 + this.couponList = this.couponList.filter(item => JSON.stringify(item) !== '{}')
  180 + this.loading = false
  181 + this.isFirstComeIn = false
  182 + }).catch(res => {
  183 + uni.hideLoading()
  184 + })
  185 + }
  186 +
  187 + },
  188 + // 跳转到可用商品列表
  189 + goProductList(item) {
  190 + console.log(item, 'test')
  191 + // return
  192 + uni.navigateTo({
  193 + url: `../coupon/product?id=${ item.couponId }&actId=${item.activityId}`
  194 + })
  195 + },
  196 + success() {
  197 + this.page = 1
  198 + this.couponList = []
  199 + this.getCouponList()
  200 + }
  201 + }
  202 + }
169 203 </script>
170 204  
171   -<style
172   - lang="scss"
173   - scoped
174   ->
175   -page {
176   - background: #F8F8F8;
177   -
178   - .couponList {
179   - padding: 0 20rpx 40upx;
180   - margin-top: 30rpx;
  205 +<style lang="scss" scoped>
  206 + page {
  207 + background: #F8F8F8;
  208 + .tabs-nav-warp {
  209 + padding: 0 20px;
  210 +
  211 + .tabs-nav {
  212 + margin-top: 20upx;
  213 +
  214 + .ul {
  215 + white-space: nowrap;
  216 +
  217 + .li {
  218 + display: inline-block;
  219 + margin-left: 60upx;
  220 + font-size: 28upx;
  221 + color: #999999;
  222 + position: relative;
  223 + padding-bottom: 18upx;
  224 +
  225 + &:first-child {
  226 + margin-left: 0;
  227 + }
  228 +
  229 + &.on {
  230 + &:after {
  231 + content: '';
  232 + width: 100%;
  233 + height: 4upx;
  234 + background: #39be7a;
  235 + position: absolute;
  236 + left: 0;
  237 + bottom: 0;
  238 + }
  239 +
  240 + font-weight:bold;
  241 + color: #333333;
  242 + }
  243 + }
  244 + }
  245 + }
  246 + }
  247 + .couponList {
  248 + padding: 0 20rpx 40upx;
  249 + margin-top: 30rpx;
181 250  
182   - .couponItem {
183   - background: #333333;
184   - margin-top: 40rpx;
185   - padding: 25rpx 35rpx;
186   - overflow: hidden;
187   - background-image: url("https://jy.scjysm.asia:18086/mefile/file/static/images/borderIcon.png");
188   - background-repeat: no-repeat;
189   - background-size: contain;
190   - background-position: right top;
  251 + .couponItem {
  252 + background: #333333;
  253 + margin-top: 40rpx;
  254 + padding: 25rpx 35rpx;
  255 + overflow: hidden;
  256 + background-image: url("https://jy.scjysm.asia:18086/mefile/file/static/images/borderIcon.png");
  257 + background-repeat: no-repeat;
  258 + background-size: contain;
  259 + background-position: right top;
191 260  
192   - .itemLeft {
193   - padding-right: 10rpx;
194   - position: relative;
195   - border-right: 2rpx dashed #666666;
196   - width: 170rpx;
  261 + .itemLeft {
  262 + padding-right: 10rpx;
  263 + position: relative;
  264 + border-right: 2rpx dashed #666666;
  265 + width: 170rpx;
197 266  
198   - .topIcon {
199   - position: absolute;
200   - right: -16rpx;
201   - top: -50rpx;
202   - width: 32rpx;
203   - height: 32rpx;
204   - background: #FFFFFF;
205   - border-radius: 50%;
206   - }
  267 + .topIcon {
  268 + position: absolute;
  269 + right: -16rpx;
  270 + top: -50rpx;
  271 + width: 32rpx;
  272 + height: 32rpx;
  273 + background: #FFFFFF;
  274 + border-radius: 50%;
  275 + }
207 276  
208   - .bottomIcon {
209   - position: absolute;
210   - right: -16rpx;
211   - bottom: -50rpx;
212   - width: 32rpx;
213   - height: 32rpx;
214   - background: #FFFFFF;
215   - border-radius: 50%;
216   - }
  277 + .bottomIcon {
  278 + position: absolute;
  279 + right: -16rpx;
  280 + bottom: -50rpx;
  281 + width: 32rpx;
  282 + height: 32rpx;
  283 + background: #FFFFFF;
  284 + border-radius: 50%;
  285 + }
217 286  
218   - //.price {
219   - // width: 100rpx;
220   - //}
221   - .unitBox {
222   - height: 70rpx;
223   - }
  287 + //.price {
  288 + // width: 100rpx;
  289 + //}
  290 + .unitBox {
  291 + height: 70rpx;
  292 + }
224 293  
225   - .unit {
226   - color: #FFEBC4;
227   - font-size: 36rpx;
228   - }
  294 + .unit {
  295 + color: #FFEBC4;
  296 + font-size: 36rpx;
  297 + }
229 298  
230   - .priceValue {
231   - font-size: 52rpx;
232   - color: #FFEBC4;
233   - }
234   - }
  299 + .priceValue {
  300 + font-size: 52rpx;
  301 + color: #FFEBC4;
  302 + }
  303 + }
235 304  
236   - .itemRight {
237   - padding-left: 45rpx;
238   - flex: 1;
  305 + .itemRight {
  306 + padding-left: 45rpx;
  307 + flex: 1;
239 308  
240   - .topInfo {
241   - padding-bottom: 10rpx;
242   - border-bottom: 2rpx solid #444444;
243   - margin-bottom: 10rpx;
  309 + .topInfo {
  310 + padding-bottom: 10rpx;
  311 + border-bottom: 2rpx solid #444444;
  312 + margin-bottom: 10rpx;
244 313  
245   - .couponDate {
246   - width: 300rpx;
247   - }
  314 + .couponDate {
  315 + width: 300rpx;
  316 + }
248 317  
249   - .exchangeBtnBox {
250   - width: 110rpx;
251   - height: 70rpx;
252   - text-align: center;
  318 + .exchangeBtnBox {
  319 + width: 110rpx;
  320 + height: 70rpx;
  321 + text-align: center;
253 322  
254   - .exchangeBtn {
255   - padding: 5rpx;
256   - border: 2rpx solid #999999;
257   - }
258   - }
259   - }
260   - }
261   - }
262   - }
  323 + .exchangeBtn {
  324 + padding: 5rpx;
  325 + border: 2rpx solid #999999;
  326 + }
  327 + }
  328 + }
  329 + }
  330 + }
  331 + }
263 332  
264   - .Put-box1 {
265   - .btn {
266   - text-align: center;
267   - margin-top: 40rpx;
268   - border: 2rpx solid #333333;
269   - height: 80upx;
270   - line-height: 80upx;
271   - width: 100%;
272   - color: #333333;
273   - }
  333 + .Put-box1 {
  334 + .btn {
  335 + text-align: center;
  336 + margin-top: 40rpx;
  337 + border: 2rpx solid #333333;
  338 + height: 80upx;
  339 + line-height: 80upx;
  340 + width: 100%;
  341 + color: #333333;
  342 + }
274 343  
275   - .submit {
276   - background-color: #333333;
277   - color: #FFEBC4;
278   - margin-left: 20rpx;
279   - }
280   - }
281   -}
  344 + .submit {
  345 + background-color: #333333;
  346 + color: #FFEBC4;
  347 + margin-left: 20rpx;
  348 + }
  349 + }
  350 + }
282 351  
283   -// 触底样式
284   -.reachBottom {
285   - margin-top: 30rpx;
286   - display: flex;
287   - flex-direction: column;
288   - align-items: center;
  352 + // 触底样式
  353 + .reachBottom {
  354 + margin-top: 30rpx;
  355 + display: flex;
  356 + flex-direction: column;
  357 + align-items: center;
289 358  
290   - .reach-icon {
291   - width: 150rpx;
292   - height: 150rpx;
293   - }
  359 + .reach-icon {
  360 + width: 150rpx;
  361 + height: 150rpx;
  362 + }
294 363  
295   - .reach-text {
296   - margin: 20rpx 0;
297   - color: #CCCCCC;
298   - }
299   -}
300   -</style>
  364 + .reach-text {
  365 + margin: 20rpx 0;
  366 + color: #CCCCCC;
  367 + }
  368 + }
  369 +</style>
301 370 \ No newline at end of file
... ...
ceres-uniapp-master/pages_category_page1/orderModule/index.vue
... ... @@ -4,19 +4,20 @@
4 4 <global-loading />
5 5  
6 6 <view style="padding-bottom:68upx;">
7   - <u-sticky
  7 + <!-- <u-sticky
8 8 bg-color="#fff"
9 9 >
10   - <u-tabs
11   - class="tabs"
12   - :list="tabList"
13   - disabled
14   - :is-scroll="false"
15   - active-color="#C5AA7B !important"
16   - :current="tabCurrentType"
17   - @change="handleTabChange"
18   - />
19   - </u-sticky>
  10 +
  11 + </u-sticky> -->
  12 + <u-tabs
  13 + class="tabs"
  14 + :list="tabList"
  15 + disabled
  16 + :is-scroll="false"
  17 + active-color="#39be7a !important"
  18 + :current="tabCurrentType"
  19 + @change="handleTabChange"
  20 + />
20 21 <view class="order-list-box u-skeleton">
21 22 <Skeleton
22 23 el-color="#efefef"
... ... @@ -813,7 +814,7 @@ page {
813 814  
814 815 .order-status {
815 816 font-size: 32upx;
816   - color: #C5AA7B;
  817 + color: #39be7a;
817 818 font-weight: 400;
818 819 }
819 820  
... ... @@ -953,8 +954,8 @@ page {
953 954 }
954 955  
955 956 .order-btn-box .btn.r {
956   - border: 2rpx solid #C5AA7B;
957   - color: #C5AA7B;
  957 + border: 2rpx solid #39be7a;
  958 + color: #39be7a;
958 959 }
959 960  
960 961 .emptyOrder-box {
... ... @@ -1008,6 +1009,6 @@ page {
1008 1009 </style>
1009 1010 <style scoped>
1010 1011 .container /deep/ .u-tab-item {
1011   - color: #39be7a !important;
  1012 + /* color: #39be7a !important; */
1012 1013 }
1013 1014 </style>
... ...
ceres-uniapp-master/pages_category_page1/orderModule/orderConfirm.vue
1 1 <template>
2   - <view>
3   - <!-- 提交订单 -->
4   - <global-loading />
5   -
6   - <view v-if="ifShow">
7   - <view class="content">
8   - <view
9   - class="address-box"
10   - @click="addAddressTap"
11   - >
12   - <image
13   - src="https://jy.scjysm.asia:18086/mefile/file/static/images/orderAddress.png"
14   - class="address-img"
15   - ></image>
16   - <!-- 有地址的 -->
17   - <view
18   - class="address-r"
19   - v-if="userAddressInfo.receiveName"
20   - >
21   - <view class="address-name-box">
22   - <text>{{ userAddressInfo.receiveName }}</text>
23   - <text class="phone">{{ userAddressInfo.receivePhone }}</text>
24   - </view>
25   - <view class="address-info">
26   - <text>{{ userAddressInfo.receiveAdress }} {{ userAddressInfo.address }}</text>
27   - </view>
28   - </view>
29   - <!-- 没有地址的 -->
30   - <view
31   - class="address-r"
32   - v-else
33   - >
34   - <text>你还没有收货地址哦,点击这里添加</text>
35   - </view>
36   - <image
37   - src="https://jy.scjysm.asia:18086/mefile/file/static/images/greyArrow.png"
38   - class="arrow-right-img"
39   - ></image>
40   - </view>
41   - <view class="order-list-box">
42   - <view
43   - class="item"
44   - v-for="(item, sIndex) in settlement.shops"
45   - :key="item.shopId"
46   - >
47   - <view class="order-list-top">
48   - <view class="top-l">
49   - <image
50   - src="https://jy.scjysm.asia:18086/mefile/file/static/images/orderStoreIcon.png"
51   - class="shop-img"
52   - >
53   - </image>
54   - <text class="shop-name">{{ item.shopName }}</text>
55   - </view>
56   - </view>
57   - <view class="order-info-box">
58   - <view class="order-info">
59   - <view
60   - class="order-info-item"
61   - v-for="(cItem, index) in item.skus"
62   - :key="cItem.productId"
63   - >
64   - <image
65   - :src="cItem.image"
66   - class="product-img"
67   - ></image>
68   - <view class="info-box">
69   - <text class="product-name">{{ cItem.productName }}</text>
70   - <view class="product-sku">
71   - <view v-for="(vItem, index) in cItem.values">
72   - <label class="mar-left-20">{{ vItem }}</label>
73   - </view>
74   - </view>
75   - <view class="price-sku-box flex-display flex-sp-between">
76   - <view class="product-price">
77   - <text class="fuhao">¥</text>
78   - {{ cItem.price }}
79   - </view>
80   - <view class="product-num">x {{ cItem.number }}</view>
81   - </view>
82   - </view>
83   - </view>
84   - <view
85   - v-if="item.receiveNotMatch"
86   - class="adressTips"
87   - >当前地址不支持配送,可更换其他地址试试
88   - </view>
89   - <view class="delivery-way-box">
90   - <view>
91   - <view class="item">
92   - <view class="flex-items">
93   - <text>配送方式</text>
94   - </view>
95   - <view class="flex-row-plus flex-items">
96   - <text v-if="item.distribution.distributionPrice > 0">快递 ¥
97   - {{ item.distribution.distributionPrice }}
98   - </text>
99   - <text v-else>快递 免邮</text>
100   - </view>
101   - </view>
102   - <view class="flex-item">
103   - <text
104   - class="font-color-666 fs24"
105   - v-for="(hItem, hIndex) of item.skuDiscountInfoMap"
106   - >{{ hItem[0] }}
107   - </text>
108   - </view>
109   - </view>
110   - </view>
111   - </view>
112   - <view
113   - class="discount-item1"
114   - v-if="item.shopCoupons.length>0"
115   - @click="showShopCoupons(item,sIndex)"
116   - >
117   - <view class="discount-label">店铺优惠</view>
118   - <view class="discount-info-box flex-items">
119   - <view
120   - class="discount-info2"
121   - v-if="item.currentCoupon && item.currentCoupon.couponType === 1"
122   - >
123   - -¥{{ item.currentCoupon.reduceMoney }}
124   - </view>
125   - <view
126   - class="discount-info2"
127   - v-if="item.currentCoupon && item.currentCoupon.couponType === 2"
128   - >
129   - {{ item.currentCoupon.reduceMoney }}折券
130   - </view>
131   - <image
132   - class="discount-img"
133   - src="https://jy.scjysm.asia:18086/mefile/file/static/images/arrowRight.png"
134   - ></image>
135   - </view>
136   -
137   - </view>
138   - <view class="order-total-box">
139   - <text class="total-num">共{{ item.number }}件</text>
140   - <text class="total-num ml10">总计</text>
141   - <text
142   - class="total-price ml10"
143   - v-if="item.totalAfterDiscount > 0"
144   - >
145   - ¥{{
  2 + <view>
  3 + <!-- 提交订单 -->
  4 + <global-loading />
  5 +
  6 + <view v-if="ifShow">
  7 + <view class="content">
  8 + <view class="address-box" @click="addAddressTap">
  9 + <image src="https://jy.scjysm.asia:18086/mefile/file/static/images/orderAddress.png"
  10 + class="address-img"></image>
  11 + <!-- 有地址的 -->
  12 + <view class="address-r" v-if="userAddressInfo.receiveName">
  13 + <view class="address-name-box">
  14 + <text>{{ userAddressInfo.receiveName }}</text>
  15 + <text class="phone">{{ userAddressInfo.receivePhone }}</text>
  16 + </view>
  17 + <view class="address-info">
  18 + <text>{{ userAddressInfo.receiveAdress }} {{ userAddressInfo.address }}</text>
  19 + </view>
  20 + </view>
  21 + <!-- 没有地址的 -->
  22 + <view class="address-r" v-else>
  23 + <text>你还没有收货地址哦,点击这里添加</text>
  24 + </view>
  25 + <image src="https://jy.scjysm.asia:18086/mefile/file/static/images/greyArrow.png"
  26 + class="arrow-right-img"></image>
  27 + </view>
  28 + <view class="order-list-box">
  29 + <view class="item" v-for="(item, sIndex) in settlement.shops" :key="item.shopId">
  30 + <view class="order-list-top">
  31 + <view class="top-l">
  32 + <image src="https://jy.scjysm.asia:18086/mefile/file/static/images/orderStoreIcon.png"
  33 + class="shop-img">
  34 + </image>
  35 + <text class="shop-name">{{ item.shopName }}</text>
  36 + </view>
  37 + </view>
  38 + <view class="order-info-box">
  39 + <view class="order-info">
  40 + <view class="order-info-item" v-for="(cItem, index) in item.skus"
  41 + :key="cItem.productId">
  42 + <image :src="cItem.image" class="product-img"></image>
  43 + <view class="info-box">
  44 + <text class="product-name">{{ cItem.productName }}</text>
  45 + <view class="product-sku">
  46 + <view v-for="(vItem, index) in cItem.values">
  47 + <label class="mar-left-20">{{ vItem }}</label>
  48 + </view>
  49 + </view>
  50 + <view class="price-sku-box flex-display flex-sp-between">
  51 + <view class="product-price">
  52 + <text class="fuhao">¥</text>
  53 + {{ cItem.price }}
  54 + </view>
  55 + <view class="product-num">x {{ cItem.number }}</view>
  56 + </view>
  57 + </view>
  58 + </view>
  59 + <view v-if="item.receiveNotMatch" class="adressTips">当前地址不支持配送,可更换其他地址试试
  60 + </view>
  61 + <view class="delivery-way-box">
  62 + <view>
  63 + <view class="item">
  64 + <view class="flex-items">
  65 + <text>配送方式</text>
  66 + </view>
  67 + <view class="flex-row-plus flex-items">
  68 + <text v-if="item.distribution.distributionPrice > 0">快递 ¥
  69 + {{ item.distribution.distributionPrice }}
  70 + </text>
  71 + <text v-else>快递 免邮</text>
  72 + </view>
  73 + </view>
  74 + <view class="flex-item">
  75 + <text class="font-color-666 fs24"
  76 + v-for="(hItem, hIndex) of item.skuDiscountInfoMap">{{ hItem[0] }}
  77 + </text>
  78 + </view>
  79 + </view>
  80 + </view>
  81 + </view>
  82 + <view class="discount-item1" v-if="item.shopCoupons.length>0"
  83 + @click="showShopCoupons(item,sIndex)">
  84 + <view class="discount-label">店铺优惠</view>
  85 + <view class="discount-info-box flex-items">
  86 + <view class="discount-info2"
  87 + v-if="item.currentCoupon && item.currentCoupon.couponType === 1">
  88 + -¥{{ item.currentCoupon.reduceMoney }}
  89 + </view>
  90 + <view class="discount-info2"
  91 + v-if="item.currentCoupon && item.currentCoupon.couponType === 2">
  92 + {{ item.currentCoupon.reduceMoney }}折券
  93 + </view>
  94 + <image class="discount-img"
  95 + src="https://jy.scjysm.asia:18086/mefile/file/static/images/arrowRight.png">
  96 + </image>
  97 + </view>
  98 +
  99 + </view>
  100 + <view class="order-total-box">
  101 + <text class="total-num">共{{ item.number }}件</text>
  102 + <text class="total-num ml10">总计</text>
  103 + <text class="total-price ml10" v-if="item.totalAfterDiscount > 0">
  104 + ¥{{
146 105 (parseFloat(item.totalAfterDiscount) + parseFloat(item.distribution.distributionPrice || 0)).toFixed(2)
147 106 }}
148   - </text>
149   - <text
150   - class="total-price ml10"
151   - v-else
152   - >¥0.00
153   - </text>
154   - </view>
155   - </view>
156   - </view>
157   -
158   - </view>
159   - <view
160   - class="discount-item"
161   - @click="showDiscount"
162   - >
163   - <view class="discount-label">平台优惠</view>
164   - <view class="discount-info-box flex-items">
165   - <view
166   - class="discount-info2"
167   - v-if="promotionInfoDTO.couponId"
168   - >
169   - <text v-if="promotionInfoDTO.couponType === 2">{{ promotionInfoDTO.reduceMoney }}折</text>
170   - <text v-else> -¥{{ promotionInfoDTO.reduceMoney | clip2Decimal }}</text>
171   - </view>
172   - <view
173   - class="discount-info1"
174   - v-else-if="couponsList.length<1"
175   - >无
176   - </view>
177   - <view
178   - class="discount-info1"
179   - v-else
180   - >不使用
181   - </view>
182   - <image
183   - class="discount-img"
184   - src="https://jy.scjysm.asia:18086/mefile/file/static/images/arrowRight.png"
185   - ></image>
186   - </view>
187   - </view>
188   - <!-- 积分支付-->
189   - <view
190   - class="integralPayBox"
191   - v-if="integralShow"
192   - >
193   - <view class="integralBg">
194   - <view class="integralTit fs26">可用{{ integralNum }}积分抵扣{{ integralPrice.toFixed(2) }}元</view>
195   - <view class="maxIntegral">
196   - <checkbox-group
197   - @change="changeIntegral"
198   - style="width: 50rpx"
199   - >
200   - <checkbox
201   - style="transform:scale(0.7);"
202   - class="integralCheckbox"
203   - color="#C5AA7B"
204   - value="1"
205   - :checked="selectIntegral"
206   - />
207   - </checkbox-group>
208   - </view>
209   - </view>
210   - </view>
211   - <view class="cashier-box">
212   - <CashierList :total-price="totalPrice" @change="handleChangeCashier" />
213   - </view>
214   - <view class="order-flow-box">
215   - <view class="flow-word">交易流程:</view>
216   - <view class="flow-word mt25">
217   - <text>1、填写收货信息并完成支付</text>
218   - <text>2、双方根据物品的交易方式进行交易</text>
219   - <text>3、拿到物品,交易结束</text>
220   - </view>
221   - <!-- 实付款不含邮费,涉及邮寄双方协定好费用,提醒发起人修改价格再完成支付;-->
222   - <view class="flow-word mt50">注:应国家邮政总局的要求,即日起涉及到个人快递包裹必须收件人实名制,否则将影响到收寄配送。请避免使用「先生,男士,小姐,女士,昵称」等模糊称谓。
223   - </view>
224   - </view>
225   - </view>
226   - <view
227   - class="order-confirm-box"
228   - style="padding-bottom:30upx;"
229   - >
230   - <view class="flex-items flex-sp-between">
231   - <text class="num-box">共{{ totalCount }}件</text>
232   - <view>
233   - <text class="total">合计:</text>
234   - <text
235   - v-if="totalPrice>0"
236   - class="price"
237   - >¥{{ totalPrice.toFixed(2) }}
238   - </text>
239   - <text
240   - v-else
241   - class="price"
242   - >¥0.00
243   - </text>
244   - </view>
245   - </view>
246   - <!-- active 当有地址时按钮加上active选中的样式-->
247   - <button
248   - v-if="isRegionalScope"
249   - class="btn unActive"
250   - type="default"
251   - :disabled="false"
252   - >提交订单
253   - </button>
254   - <button
255   - v-else
256   - :class="[submitActive ? 'btn active' : 'btn']"
257   - @click="submitOrder"
258   - >提交订单
259   - </button>
260   - <!-- <text class="btn" v-else>提交订单</text> -->
261   -
262   - </view>
263   - <!-- 活动弹框 -->
264   - <u-popup
265   - class="activity-con"
266   - v-model="isShowDiscount"
267   - mode="bottom"
268   - border-radius="14"
269   - close-icon-pos="top-right"
270   - close-icon-size="20"
271   - >
272   - <view
273   - class="activity-box"
274   - style="height: 1000rpx;"
275   - >
276   - <view class="title-box">
277   - <image
278   - class="close-btn"
279   - @click="onDiscountClose"
280   - src="https://jy.scjysm.asia:18086/mefile/file/static/images/close.png"
281   - ></image>
282   - </view>
283   - <view class="activity-coupon-box">
284   - <scroll-view
285   - scroll-y="true"
286   - style="height: 900rpx;"
287   - >
288   - <view class="content-box">
289   - <view v-if="usableListLength">
290   - <view class="label-lingqu">可用优惠券列表</view>
291   - <view class="couponBox">
292   - <view
293   - class="coupon-item"
294   - v-for="(usableItem, index) in settlement.coupons"
295   - :key="index"
296   - @click="couponItemTap(index, usableItem)"
297   - >
298   - <view
299   - class="money-box"
300   - v-if="usableItem.couponType === 1"
301   - >
302   - ¥{{ usableItem.reduceMoney }}
303   - </view>
304   - <view
305   - class="money-box"
306   - v-else
307   - >{{ usableItem.reduceMoney }}折券
308   - </view>
309   - <view class="info-box">
310   - <view
311   - class="date font-color-999"
312   - style="font-size:22upx; margin-top: 20upx;"
313   - >
314   - {{
  107 + </text>
  108 + <text class="total-price ml10" v-else>¥0.00
  109 + </text>
  110 + </view>
  111 + </view>
  112 + </view>
  113 +
  114 + </view>
  115 + <view class="discount-item" @click="changecoupon">
  116 + <view class="discount-label">优惠券选择</view>
  117 + <view class="discount-info-box flex-items">
  118 + <!-- <view class="discount-info2" v-if="promotionInfoDTO.couponId">
  119 + <text v-if="promotionInfoDTO.couponType === 2">{{ promotionInfoDTO.reduceMoney }}折</text>
  120 + <text v-else> -¥{{ promotionInfoDTO.reduceMoney | clip2Decimal }}</text>
  121 + </view>
  122 + <view class="discount-info1" v-else-if="couponsList.length<1">无
  123 + </view>
  124 + <view class="discount-info1" v-else>不使用
  125 + </view> -->
  126 + <view class="discount-info1" v-if="couponList.length == 0">暂无优惠券</view>
  127 + <view class="discount-info1" v-else-if="couponId.couponName">{{couponId.couponName}}</view>
  128 + <view class="discount-info1" v-else>暂无选择</view>
  129 + <image class="discount-img"
  130 + src="https://jy.scjysm.asia:18086/mefile/file/static/images/arrowRight.png"></image>
  131 + </view>
  132 + </view>
  133 + <!-- 积分支付-->
  134 + <view class="integralPayBox" v-if="integralShow">
  135 + <view class="integralBg">
  136 + <view class="integralTit fs26">可用{{ integralNum }}积分抵扣{{ integralPrice.toFixed(2) }}元</view>
  137 + <view class="maxIntegral">
  138 + <checkbox-group @change="changeIntegral" style="width: 50rpx">
  139 + <checkbox style="transform:scale(0.7);" class="integralCheckbox" color="#C5AA7B"
  140 + value="1" :checked="selectIntegral" />
  141 + </checkbox-group>
  142 + </view>
  143 + </view>
  144 + </view>
  145 + <view class="cashier-box">
  146 + <CashierList :total-price="totalPrice" @change="handleChangeCashier" />
  147 + </view>
  148 + <view class="order-flow-box">
  149 + <view class="flow-word">交易流程:</view>
  150 + <view class="flow-word mt25">
  151 + <text>1、填写收货信息并完成支付</text>
  152 + <text>2、双方根据物品的交易方式进行交易</text>
  153 + <text>3、拿到物品,交易结束</text>
  154 + </view>
  155 + <!-- 实付款不含邮费,涉及邮寄双方协定好费用,提醒发起人修改价格再完成支付;-->
  156 + <view class="flow-word mt50">
  157 + 注:应国家邮政总局的要求,即日起涉及到个人快递包裹必须收件人实名制,否则将影响到收寄配送。请避免使用「先生,男士,小姐,女士,昵称」等模糊称谓。
  158 + </view>
  159 + </view>
  160 + </view>
  161 + <view class="order-confirm-box" style="padding-bottom:30upx;">
  162 + <view class="flex-items flex-sp-between">
  163 + <text class="num-box">共{{ totalCount }}件</text>
  164 + <view>
  165 + <text v-if="ptyh" style="color: #999;font-size: 24rpx;">(平台优惠:¥{{ptyh}})</text>
  166 + <text class="total">合计:</text>
  167 + <text v-if="totalPrice>0" class="price">¥{{ (totalPrice - ptyh).toFixed(2) }}
  168 + </text>
  169 + <text v-else class="price">¥0.00
  170 + </text>
  171 + </view>
  172 + </view>
  173 + <!-- active 当有地址时按钮加上active选中的样式-->
  174 + <button v-if="isRegionalScope" class="btn unActive" type="default" :disabled="false">提交订单
  175 + </button>
  176 + <button v-else :class="[submitActive ? 'btn active' : 'btn']" @click="submitOrder">提交订单
  177 + </button>
  178 + <!-- <text class="btn" v-else>提交订单</text> -->
  179 +
  180 + </view>
  181 + <!-- 活动弹框 -->
  182 + <u-popup class="activity-con" v-model="isShowDiscount" mode="bottom" border-radius="14"
  183 + close-icon-pos="top-right" close-icon-size="20">
  184 + <view class="activity-box" style="height: 1000rpx;">
  185 + <view class="title-box">
  186 + <image class="close-btn" @click="onDiscountClose"
  187 + src="https://jy.scjysm.asia:18086/mefile/file/static/images/close.png"></image>
  188 + </view>
  189 + <view class="activity-coupon-box">
  190 + <scroll-view scroll-y="true" style="height: 900rpx;">
  191 + <view class="content-box">
  192 + <view>
  193 + <view class="label-lingqu">可用优惠券列表</view>
  194 + <view class="couponBox">
  195 + <view class="coupon-item" v-for="(usableItem, index) in settlement.coupons"
  196 + :key="index" @click="couponItemTap(index, usableItem)">
  197 + <view class="money-box" v-if="usableItem.couponType === 1">
  198 + ¥{{ usableItem.reduceMoney }}
  199 + </view>
  200 + <view class="money-box" v-else>{{ usableItem.reduceMoney }}折券
  201 + </view>
  202 + <view class="info-box">
  203 + <view class="date font-color-999"
  204 + style="font-size:22upx; margin-top: 20upx;">
  205 + {{
315 206 getDate(usableItem.startTime.replace(/-/g, '.'))
316 207 }}-{{ getDate(usableItem.endTime.replace(/-/g, '.')) }}
317   - </view>
318   - <view class="info font-color-999">满{{ usableItem.fullMoney }}元可用</view>
319   - </view>
320   - <image
321   - class="check-img"
322   - src="https://jy.scjysm.asia:18086/mefile/file/static/images/selectActive.png"
323   - v-if="usableItem.checked"
324   - ></image>
325   - <image
326   - class="check-img"
327   - src="https://jy.scjysm.asia:18086/mefile/file/static/images/selectEmpty.png"
328   - v-else
329   - >
330   - </image>
331   - </view>
332   - </view>
333   - </view>
334   - </view>
335   - </scroll-view>
336   - </view>
337   - </view>
338   - </u-popup>
339   - <u-popup
340   - class="activity-con"
341   - v-model="isShopCoupons"
342   - mode="bottom"
343   - border-radius="14"
344   - close-icon-pos="top-right"
345   - close-icon-size="20"
346   - >
347   - <view class="activity-box">
348   - <view class="title-box">
349   - <image
350   - class="close-btn"
351   - @click="onshopClose"
352   - src="https://jy.scjysm.asia:18086/mefile/file/static/images/close.png"
353   - ></image>
354   - </view>
355   - <view class="activity-coupon-box">
356   - <scroll-view
357   - scroll-y="true"
358   - style="height: 900rpx;"
359   - >
360   - <view class="content-box">
361   - <view v-if="shopCouponsLength">
362   - <view class="label-lingqu">可用优惠券列表</view>
363   - <view class="couponBox">
364   - <view
365   - class="coupon-item"
366   - v-for="(sItem, index) in shopCouponslist.shopCoupons"
367   - :key="sItem.id"
368   - @click="shopCouponItemTap(index,sItem)"
369   - >
370   - <view
371   - class="money-box"
372   - v-if="sItem.couponType === 1"
373   - >¥{{ sItem.reduceMoney }}
374   - </view>
375   - <view
376   - class="money-box"
377   - v-else
378   - >{{ sItem.reduceMoney }}折券
379   - </view>
380   - <view
381   - class="date font-color-999"
382   - style="font-size:22upx; margin-top: 10upx;"
383   - >
384   - {{ getDate(sItem.startTime.replace(/-/g, '.')) }}-{{
  208 + </view>
  209 + <view class="info font-color-999">满{{ usableItem.fullMoney }}元可用</view>
  210 + </view>
  211 + <image class="check-img"
  212 + src="https://jy.scjysm.asia:18086/mefile/file/static/images/selectActive.png"
  213 + v-if="usableItem.checked"></image>
  214 + <image class="check-img"
  215 + src="https://jy.scjysm.asia:18086/mefile/file/static/images/selectEmpty.png"
  216 + v-else>
  217 + </image>
  218 + </view>
  219 + </view>
  220 + </view>
  221 + </view>
  222 + </scroll-view>
  223 + </view>
  224 + </view>
  225 + </u-popup>
  226 + <u-popup class="activity-con" v-model="isShopCoupons" mode="bottom" border-radius="14"
  227 + close-icon-pos="top-right" close-icon-size="20">
  228 + <view class="activity-box">
  229 + <view class="title-box">
  230 + <image class="close-btn" @click="onshopClose"
  231 + src="https://jy.scjysm.asia:18086/mefile/file/static/images/close.png"></image>
  232 + </view>
  233 + <view class="activity-coupon-box">
  234 + <scroll-view scroll-y="true" style="height: 900rpx;">
  235 + <view class="content-box">
  236 + <view v-if="shopCouponsLength">
  237 + <view class="label-lingqu">可用优惠券列表</view>
  238 + <view class="couponBox">
  239 + <view class="coupon-item" v-for="(sItem, index) in shopCouponslist.shopCoupons"
  240 + :key="sItem.id" @click="shopCouponItemTap(index,sItem)">
  241 + <view class="money-box" v-if="sItem.couponType === 1">
  242 + ¥{{ sItem.reduceMoney }}
  243 + </view>
  244 + <view class="money-box" v-else>{{ sItem.reduceMoney }}折券
  245 + </view>
  246 + <view class="date font-color-999"
  247 + style="font-size:22upx; margin-top: 10upx;">
  248 + {{ getDate(sItem.startTime.replace(/-/g, '.')) }}-{{
385 249 getDate(sItem.endTime.replace(/-/g, '.'))
386 250 }}
387   - </view>
388   - <view class="info-box">
389   - <view class="info font-color-999">满{{ sItem.fullMoney }}元可用</view>
390   - </view>
391   - <image
392   - class="check-img"
393   - src="https://jy.scjysm.asia:18086/mefile/file/static/images/selectActive.png"
394   - v-if="sItem.checked"
395   - ></image>
396   - <image
397   - class="check-img"
398   - src="https://jy.scjysm.asia:18086/mefile/file/static/images/selectEmpty.png"
399   - v-else
400   - >
401   - </image>
402   - </view>
403   - </view>
404   - </view>
405   - </view>
406   - </scroll-view>
407   - </view>
408   - </view>
409   - </u-popup>
410   - </view>
411   - </view>
  251 + </view>
  252 + <view class="info-box">
  253 + <view class="info font-color-999">满{{ sItem.fullMoney }}元可用</view>
  254 + </view>
  255 + <image class="check-img"
  256 + src="https://jy.scjysm.asia:18086/mefile/file/static/images/selectActive.png"
  257 + v-if="sItem.checked"></image>
  258 + <image class="check-img"
  259 + src="https://jy.scjysm.asia:18086/mefile/file/static/images/selectEmpty.png"
  260 + v-else>
  261 + </image>
  262 + </view>
  263 + </view>
  264 + </view>
  265 + </view>
  266 + </scroll-view>
  267 + </view>
  268 + </view>
  269 + </u-popup>
  270 + <u-popup class="activity-con" v-model="iscoupon" mode="bottom" border-radius="14"
  271 + close-icon-pos="top-right" close-icon-size="20">
  272 + <view class="activity-box" style="height: 1000rpx;">
  273 + <view class="title-box">
  274 + <image class="close-btn" @click="iscoupon=false"
  275 + src="https://jy.scjysm.asia:18086/mefile/file/static/images/close.png"></image>
  276 + </view>
  277 + <view class="activity-coupon-box">
  278 + <scroll-view scroll-y="true" style="height: 900rpx;">
  279 + <view class="content-box">
  280 + <view>
  281 + <view class="label-lingqu">可用优惠券列表</view>
  282 + <view class="couponBox" v-if="couponList.length>0&&this.settlement.shops&&this.settlement.shops.length>0">
  283 + <view :style="usableItem.istrue?'opacity: 1;':'opacity: 0.5;'" style="" class="coupon-item" v-for="(usableItem, index) in couponList"
  284 + :key="index" @click="couponcouponList(index, usableItem)">
  285 + <view class="money-box" v-if="usableItem.couponType == '1'">
  286 + ¥{{ usableItem.discountContent }}
  287 + </view>
  288 + <view class="money-box" v-else>{{ usableItem.discountContent }}折券
  289 + </view>
  290 + <view class="info-box">
  291 + <view class="date font-color-999"
  292 + style="font-size:22upx; margin-top: 20upx;">
  293 + {{
  294 + getDate(usableItem.startTime.replace(/-/g, '.'))
  295 + }}-{{ getDate(usableItem.endTime.replace(/-/g, '.')) }}
  296 + </view>
  297 + <view class="info font-color-999">{{usableItem.couponType == '1'?'满'+usableItem.usageThreshold+'元可用':'最高'+usableItem.maxDiscountAmount+'元'}}</view>
  298 + </view>
  299 + <image class="check-img"
  300 + src="https://jy.scjysm.asia:18086/mefile/file/static/images/selectActive.png"
  301 + v-if="usableItem.checked"></image>
  302 + <image class="check-img"
  303 + src="https://jy.scjysm.asia:18086/mefile/file/static/images/selectEmpty.png"
  304 + v-else>
  305 + </image>
  306 + </view>
  307 + </view>
  308 + </view>
  309 + </view>
  310 + </scroll-view>
  311 + </view>
  312 + </view>
  313 + </u-popup>
  314 + </view>
  315 + </view>
412 316 </template>
413 317  
414 318 <script>
415   -import { hidden } from "../../utils/hidden";
416   -import { handleDoPay } from "../../utils/payUtil";
417   -
418   -const NET = require('../../utils/request')
419   -const API = require('../../config/api')
420   -import CashierList from "../../components/CashierList";
421   -export default {
422   - components:{CashierList},
423   - data() {
424   - return {
425   - // 埋点ID
426   - pointProductIds: '',
427   - couponActiveShowFalg: false,
428   - settlement: {},
429   - type: 0,
430   - skuItemDTOList: [],
431   - userAddressInfo: {},
432   - isShowDiscount: false,
433   - isShopCoupons: false,
434   - usableListLength: 0,
435   - shopCouponsLength: 0,
436   - shopCouponslist: [],
437   - promotionInfoDTO: {
438   - couponId: 0,
439   - ifAdd: 1,
440   - reduceMoney: 0
441   - },
442   - shopInfoDTO: {},
443   - reduceMoney: 0,
444   - submitActive: true,
445   - distributionPrice: 0, //运费
446   - totalPrice: 0, //合计
447   - receiveId: '',
448   - totalCount: 0,
449   - skuItemList: {},
450   - shopGroupWorkId: 0,
451   - sumitType: '',
452   - collageId: null,
453   - couponIfAdd: true,
454   - couponsList: [],
455   - shopCouIndex: 0, //优惠券index
456   - shopIndex: 0,
457   - shopCheckedType: true,
458   - discountPrice: 0,
459   - selectShopCoupon: [], // 已选择店铺优惠券
460   - huabeiDetail: true,
461   - showHuabeiPopup: false,
462   - huabeiChargeType: 0,
463   - huabeiFeerateList: [],
464   - paymentMode: 0, //支付方式 1-微信支付 2-支付宝支付 3-花呗分期
465   - huabeiPeriod: 3, //选择的花呗分期数 有 3 6 12 3种选项,默认是3
466   - chargeFeeList: [], //花呗每期的手续费
467   - fenqiFeeList: [], //花呗每期的支付额
468   - showWechatPayType: false,
469   - showAlipayPayType: false,
470   - showHuabeiPayType: false,
471   - orderId: null,
472   - couponType: 0,
473   - selectIntegral: true,
474   - integralNum: 0,
475   - ifShow: false,
476   - integralRatio: 0, // 积分兑换比例
477   - integralPrice: 0, // 总积分可减多少元
478   - orderCreditThreshold: 0, // 满多少元可以抵扣
479   - integralShow: false, // 显示隐藏积分
480   - checkedPlatformCoupon: undefined,
481   - oneClickSubmit: true, //只提交订单一次
482   - isRegionalScope: false, //是否在商家配置范围内地址
483   - payObj:{} // 支付相关
484   - }
485   - },
486   - onLoad(options) {
487   - this.getQuery()
488   - console.log(options, 'options')
489   - this.type = options.type
490   - if (options.receiveId) {
491   - this.receiveId = options.receiveId
492   - }
493   - },
494   - onShow() {
495   - if (uni.getStorageSync("receiveItem")) {
496   - this.receiveId = uni.getStorageSync("receiveItem").receiveId
497   - }
498   - if (uni.getStorageSync("skuItemDTOList") != "") {
499   - this.skuItemDTOList = uni.getStorageSync('skuItemDTOList')
500   - console.log(this.skuItemDTOList, '66666')
501   - if (this.skuItemDTOList[0].shopDiscountId > 0) {
502   - this.sumitType = 4
503   - } else if (this.skuItemDTOList[0].shopSeckillId > 0) {
504   - this.sumitType = 3
505   - }
506   - this.getSettlement(false)
507   - } else if (uni.getStorageSync("skuItemList") != "") {
508   - this.skuItemList = uni.getStorageSync("skuItemList")
509   - //console.log(this.skuItemList, 999)
510   - this.shopGroupWorkId = this.skuItemList.shopGroupWorkId
511   - this.sumitType = this.skuItemList.type
512   - this.collageId = this.skuItemList.collageId
513   - this.getSettlement(true)
514   - }
515   - },
516   - onBackPress(e) {
517   - if (e.from === 'navigateBack') {
518   - return false;
519   - }
520   - this.back();
521   - return true
522   - },
523   - filters: {
524   - clip2Decimal(value) {
525   - if (value === undefined || value === null) {
526   - return "0.00"
527   - }
528   - return (parseInt(value * 100) / 100).toFixed(2)
529   - }
530   - },
531   - methods: {
532   - getQuery() {
533   - NET.request(API.Query, {
534   - name: 'credit_exchange_rate'
535   - }, 'GET').then(res => {
536   - this.integralRatio = parseFloat(res.data.dictDescribe)
537   - }).catch(res => {
538   - console.log('平台端未配置积分兑换比例(1积分抵扣多少金额)')
539   - })
540   - },
541   - // 积分价格计算
542   - changeIntegral() {
543   - this.selectIntegral = !this.selectIntegral
544   - if (this.selectIntegral) {
545   - this.totalPrice = this.totalPrice - this.integralPrice
546   - } else {
547   - this.totalPrice = this.totalPrice + this.integralPrice
548   - }
549   - },
550   - back() {
551   - if (this.type == 2 || this.type) {
552   - uni.switchTab({
553   - url: '../../pages/tabbar/cart/index'
554   - })
555   - } else {
556   - uni.navigateBack({
557   - delta: 1
558   - });
559   - }
560   - },
561   - // 获取订单信息
562   - getSettlement(isGroup) {
563   - uni.showLoading({
564   - title: '加载中...',
565   - })
566   - this.ifShow = true
567   - let _url = '',
568   - _data = ''
569   - // 是否是拼团
570   - if (isGroup) {
571   - _url = API.getGroupSettlement
572   - _data = this.skuItemList
573   - } else {
574   - _url = API.Settlement
575   - _data = {
576   - type: this.type,
577   - shops: this.skuItemDTOList,
578   - receiveId: this.receiveId
579   - }
580   - // composeId: 68
581   - console.log(this.skuItemDTOList, 'this.skuItemDTOList')
582   - }
583   - NET.request(_url, _data, 'POST').then(res => {
584   - uni.hideLoading()
585   - this.settlement = res.data
586   - this.couponsList = res.data.coupons
587   - this.huabeiChargeType = res.data.huabeiChargeType
588   - if (this.huabeiChargeType === 2) {
589   - this.huabeiFeerateList = res.data.huabeiFeerateList
590   - } else {
591   - this.huabeiFeerateList = [0, 0, 0]
592   - }
593   - let shopLen = this.settlement.shops.length
594   - this.settlement.shops.forEach((value) => {
595   - value['totalNum'] = value.total
596   - value['pricing'] = 0
597   - })
598   - // 如果没有地址时进入购买宝贝页面对下面的商品件数和总计进行赋值
599   - if (!this.settlement.receive.receiveAdress) {
600   - this.settlement.shops.map(item => {
601   - this.totalCount += item.number
602   - this.totalPrice += item.total || item.totalNum
603   - })
604   - }
605   - // 初始化平台券选中状态
606   - if (this.settlement.coupons.length > 0) {
607   - this.settlement.coupons.forEach((item) => {
608   - item.checked = false
609   - })
610   - }
611   - this.settlement.shops.forEach((item) => {
612   - item.totalAfterDiscount = item.total
613   - })
614   - // 默认选中商家的第一张优惠券
615   - for (let s = 0; s < shopLen; s++) {
616   - const curShop = this.settlement.shops[s]
617   - curShop.skus.forEach((item) => {
618   - item['skuTotalNum'] = item.total
619   - })
620   - if (curShop.shopCoupons.length > 0) {
621   - curShop.shopCoupons.forEach((item) => {
622   - item.checked = false
623   - })
624   - const firstShopCoupon = curShop.shopCoupons[0];
625   - this.shopCouponItemTap(0, firstShopCoupon)
626   -
627   - /*let useCoupon = this.useShopCoupon(s, 0)
628   - if (useCoupon) {
629   - firstShopCoupon.checked = true
630   - this.selectShopCoupon.push(firstShopCoupon)
631   - curShop['currentCoupon'] = firstShopCoupon
632   - } else {
633   - curShop.totalNum = curShop.total
634   - }*/
635   - }
636   - }
637   -
638   - if (uni.getStorageSync('receiveItem')) {
639   - let receiveItem = uni.getStorageSync('receiveItem')
640   - this.userAddressInfo = receiveItem
641   - this.receiveId = receiveItem.receiveId
642   - this.userAddressInfo.receivePhone = hidden(this.userAddressInfo.receivePhone, 3, 4)
643   - } else if (res.data.receive) {
644   - this.receiveId = res.data.receive.receiveId
645   - this.userAddressInfo = res.data.receive
646   - this.userAddressInfo.receivePhone = hidden(this.userAddressInfo.receivePhone, 3, 4)
647   - }
648   - uni.removeStorageSync('receiveItem')
649   - this.usableListLength = res.data.coupons.length
650   - this.isReceiveCan()
651   - this.getTotal()
652   - }).catch(res => {
653   - uni.hideLoading()
654   - })
655   - },
656   - // 根据地址判断是否能下单
657   - isReceiveCan() {
658   - this.settlement.shops.map(item => {
659   - if (item.receiveNotMatch) {
660   - this.isRegionalScope = item.receiveNotMatch
661   - }
662   - if (this.isRegionalScope) {
663   - uni.showToast({
664   - title: '当前地址不支持配送,请参与红色字提示',
665   - icon: 'none'
666   - })
667   - }
668   - })
669   - },
670   -
671   - addAddressTap() {
672   - uni.navigateTo({
673   - url: '../../pages_category_page2/userModule/address?type=' + this.type,
674   - })
675   - },
676   - getDate(time) {
677   - if (!time) return '';
678   - return time.split(' ')[0]
679   - },
680   - // 平台优惠券选择
681   - couponItemTap(index, coupon) {
682   - if (!coupon.checked && this.selectShopCoupon.length) { // 判断商家券情况
683   - uni.showToast({
684   - title: '不可与商家券叠加使用!',
685   - icon: 'none'
686   - })
687   - return false
688   - }
689   - // 已选中的情况下取消选中
690   - if (coupon.checked) {
691   - let promotionInfoDTO = {}
692   - if (coupon.couponId) {
693   - promotionInfoDTO['couponId'] = 0
694   - promotionInfoDTO['ifAdd'] = 1
695   - promotionInfoDTO['reduceMoney'] = 0
696   - }
697   - this.promotionInfoDTO = promotionInfoDTO
698   - coupon.checked = false
699   - this.isShowDiscount = false
700   - this.checkedPlatformCoupon = undefined
701   - this.settlement.shops.forEach(shopItem => {
702   - if (shopItem.skus) {
703   - shopItem.skus.forEach(skuItem => {
704   - skuItem.buyerCouponId = null
705   - })
706   - }
707   - })
708   - this.getTotal()
709   - } else {
710   - // 先把所有已选中的平台优惠券改为未选中
711   - this.settlement.coupons.forEach((item) => {
712   - item.checked = false
713   - })
714   - let totalPrice = 0 // 订单总价
715   - let shopsLen = this.settlement.shops.length // 结算页店铺数量
716   - let matchCouponSkuList = []
717   - for (let i = 0; i < shopsLen; i++) {
718   - let matchCouponNormalPrice = 0
719   - let priceCount = 0
720   - const curShop = this.settlement.shops[i]
721   - let skuLen = curShop.skus.length
722   - let tmpPriceSkuList = []
723   - for (let j = 0; j < skuLen; j++) {
724   - const curSku = curShop.skus[j]
725   - if (curSku.priceId > 0) {
726   - priceCount++
727   - }
728   - const ids = coupon.ids
729   - if (ids.indexOf(curSku.productId) > -1) {
730   - if (curSku.priceId > 0) {
731   - tmpPriceSkuList.push(curSku)
732   - } else {
733   - matchCouponSkuList.push(curSku)
734   - matchCouponNormalPrice = matchCouponNormalPrice + curSku.price * curSku.number
735   - }
736   - }
737   - }
738   - if (priceCount === tmpPriceSkuList.length) {
739   - totalPrice += curShop.priceAfterDiscount
740   - matchCouponSkuList = matchCouponSkuList.concat(tmpPriceSkuList)
741   - }
742   - totalPrice += matchCouponNormalPrice
743   - }
744   - if (this.settlement.shops[this.shopIndex].total < coupon.fullMoney) {
745   - uni.showToast({
746   - title: '不满足优惠券使用条件!',
747   - icon: 'none'
748   - })
749   - return false
750   - }
751   - if (coupon.couponType === 1 && coupon.reduceMoney >= totalPrice) {
752   - uni.showToast({
753   - title: '不可使用大于等于合计金额的优惠劵!',
754   - icon: 'none'
755   - })
756   - return false
757   - }
758   - // 如果是折扣券,需要记录,在什么基数上打折
759   - coupon.useMoney = totalPrice
760   - let promotionInfoDTO = {}
761   - if (coupon.couponId) {
762   - promotionInfoDTO['couponId'] = coupon.couponId
763   - promotionInfoDTO['ifAdd'] = coupon.ifAdd
764   - promotionInfoDTO['couponType'] = coupon.couponType
765   - promotionInfoDTO['reduceMoney'] = coupon.reduceMoney
766   - }
767   - this.promotionInfoDTO = promotionInfoDTO
768   - this.isShowDiscount = false
769   - this.checkedPlatformCoupon = coupon
770   - matchCouponSkuList.forEach(item => {
771   - item.buyerCouponId = coupon.couponId
772   - })
773   - this.getTotal()
774   - // 选中优惠券
775   - coupon.checked = true
776   - }
777   - },
778   - // 店铺优惠券选择
779   - shopCouponItemTap(index, coupon) {
780   - console.log(index,coupon.checked)
781   - // 取消选择优惠券
782   - if (coupon.checked) {
783   - coupon.checked = false
784   - this.settlement.shops[this.shopIndex].totalAfterDiscount = this.settlement.shops[this.shopIndex].total
785   - this.settlement.shops[this.shopIndex].currentCoupon = {}
786   - this.settlement.shops[this.shopIndex].skus.forEach(item => {
787   - item.buyerShopCouponId = null
788   - })
789   - this.isShopCoupons = false
790   - this.selectShopCoupon = []
791   - this.getTotal()
792   - return false
793   - }
794   - if (this.settlement.shops[this.shopIndex].total < coupon.fullMoney) {
795   - uni.showToast({
796   - title: '不满足优惠券使用条件!',
797   - icon: 'none'
798   - })
799   - } else if (coupon.couponType === 1 && this.settlement.shops[this.shopIndex].total < coupon.reduceMoney) {
800   - uni.showToast({
801   - title: '不可使用大于商品金额的优惠劵!',
802   - icon: 'none'
803   - })
804   - } else {
805   - // 选择优惠券
806   - if (this.promotionInfoDTO.couponId !== 0) {
807   - uni.showToast({
808   - title: '此券不可与平台券叠加!',
809   - icon: 'none'
810   - })
811   - return false
812   - }
813   - if (coupon.couponType === 1) {
814   - if (coupon.reduceMoney >= this.settlement.shops[this.shopIndex].total) {
815   - uni.showToast({
816   - title: '优惠券优惠金额不能大于等于合计金额!',
817   - icon: 'none'
818   - })
819   - return false
820   - }
821   - }
822   -
823   - this.isShopCoupons = false
824   - let useCoupon = this.useShopCoupon(this.shopIndex, index)
825   - console.log(useCoupon)
826   - if (useCoupon) {
827   - // 确认使用当前点击的商家券,先将所有的商家券取消选中
828   - for (let i = 0; i < this.selectShopCoupon.length; i++) {
829   - this.selectShopCoupon[i].checked = false
830   - }
831   - this.selectShopCoupon = []
832   -
833   - coupon.checked = true
834   - this.settlement.shops[this.shopIndex].currentCoupon = coupon
835   - this.settlement.shops[this.shopIndex].skus.forEach(item => {
836   - if (item.buyerShopCouponId > 0 && item.buyerShopCouponId !== coupon.shopCouponId) {
837   - item.buyerShopCouponId = null
838   - }
839   - })
840   - this.selectShopCoupon.push(coupon)
841   - } else {
842   - this.settlement.shops[this.shopIndex].totalAfterDiscount = this.settlement.shops[this.shopIndex].total
843   - }
844   - this.getTotal()
845   - }
846   - },
847   - useShopCoupon(shopIndex, couponIndex) {
848   - const curShop = this.settlement.shops[shopIndex]
849   - curShop.totalAfterDiscount = 0
850   - let curCoupon
851   - if (curShop.shopCoupons && curShop.shopCoupons.length > 0) {
852   - curCoupon = curShop.shopCoupons[couponIndex]
853   - }
854   - if (!curCoupon) {
855   - return false
856   - }
857   - let useCoupon = false
858   - let matchCouponNormalSkuList = []
859   - let matchCouponPriceSkuList = []
860   - if (curCoupon.applyType !== 1) {
861   - const ids = curCoupon.ids
862   - let skuLength = curShop.skus.length
863   - // 符合优惠券商品列表中的普通sku价格综合
864   -
865   - let matchCouponNormalPrice = 0
866   - // 符合定价捆绑且在优惠券商品列表中的价格综合
867   - let matchCouponPricePrice = 0
868   - // 符合定价捆绑活动的sku数量
869   - let priceCount = 0
870   - for (let idx = 0; idx < skuLength; idx++) {
871   - let curSku = curShop.skus[idx]
872   - if (curSku.priceId > 0) {
873   - priceCount++
874   - }
875   - if (ids.indexOf(curSku.productId) > -1) {
876   - if (curSku.priceId > 0) {
877   - matchCouponPriceSkuList.push(curSku)
878   - } else {
879   - matchCouponNormalSkuList.push(curSku)
880   - matchCouponNormalPrice = matchCouponNormalPrice + curSku.price * curSku.number
881   - }
882   - }
883   - }
884   - // 如果定价捆绑的所有sku都符合优惠券
885   - if (priceCount === matchCouponPriceSkuList.length) {
886   - matchCouponPricePrice = curShop.priceAfterDiscount
887   - }
888   - // 符合的sku的price加起来是否满足满减的条件
889   - const priceFinal = matchCouponPricePrice + matchCouponNormalPrice
890   - if (priceFinal < curCoupon.fullMoney || (curCoupon.couponType === 1 && priceFinal <= curCoupon
891   - .reduceMoney)) {
892   - return false
893   - }
894   - // 判断是满减,还是折扣
895   - if (curCoupon.couponType === 1) {
896   - curShop.totalAfterDiscount = curShop.total - curCoupon.reduceMoney
897   - useCoupon = true
898   - } else {
899   - // 打折后优惠抵扣的金额
900   - let priceDiscount = (priceFinal * ((10 - curCoupon.reduceMoney) / 10)).toFixed(2)
901   - let tmpTotal = curShop.total - priceDiscount
902   - if (tmpTotal.toFixed(2) >= 0.01) {
903   - curShop.totalAfterDiscount = tmpTotal.toFixed(2)
904   - useCoupon = true
905   - }
906   - }
907   - if (useCoupon) {
908   - // 满足的sku设置buyerShopCouponId
909   - if (priceCount === matchCouponPriceSkuList.length) {
910   - let length1 = matchCouponPriceSkuList.length
911   - for (let idx = 0; idx < length1; idx++) {
912   - matchCouponPriceSkuList[idx].buyerShopCouponId = curCoupon.shopCouponId
913   - }
914   - }
915   - let length2 = matchCouponNormalSkuList.length
916   - for (let idx = 0; idx < length2; idx++) {
917   - matchCouponNormalSkuList[idx].buyerShopCouponId = curCoupon.shopCouponId
918   - }
919   - }
920   - } else {
921   - if (curCoupon.couponType === 1) {
922   - if (curShop.total > curCoupon.reduceMoney) {
923   - curShop.totalAfterDiscount = curShop.total - curCoupon.reduceMoney
924   - useCoupon = true
925   - }
926   - } else {
927   - if (curShop.total > curCoupon.fullMoney) {
928   - let priceDiscount = (curShop.total * ((10 - curCoupon.reduceMoney) / 10)).toFixed(2)
929   - let tmpTotal = curShop.total - priceDiscount
930   - if (tmpTotal.toFixed(2) >= 0.01) {
931   - curShop.totalAfterDiscount = tmpTotal.toFixed(2)
932   - useCoupon = true
933   - }
934   - }
935   - }
936   - if (useCoupon) {
937   - let skuLength = curShop.skus.length
938   - for (let idx = 0; idx < skuLength; idx++) {
939   - curShop.skus[idx].buyerShopCouponId = curCoupon.shopCouponId
940   - }
941   - }
942   - }
943   - return useCoupon
944   - },
945   - /**
946   - * 计算总价,商家券的优惠计算,在调用本方法之前已经计算好在shops[].totalAfterDiscount
947   - */
948   - getTotal() {
949   - this.totalPrice = 0
950   - this.totalCount = 0
951   - this.integralPrice = 0
952   - this.integralNum = 0
953   - let shopSumPrice = 0
954   - let shopsLen = this.settlement.shops.length
955   - console.log(this.settlement, 'fsfsfs')
956   - for (let i = 0; i < shopsLen; i++) {
957   - this.totalPrice += parseFloat(this.settlement.shops[i].totalAfterDiscount)
958   - shopSumPrice += parseFloat(this.settlement.shops[i].totalAfterDiscount)
959   - this.totalCount += this.settlement.shops[i].number
960   - }
961   -
962   - if (this.checkedPlatformCoupon) {
963   - const couponType = this.checkedPlatformCoupon.couponType
964   - const reduceMoney = this.checkedPlatformCoupon.reduceMoney
965   - if (couponType === 1 && this.totalPrice - reduceMoney > 0) { // 满减
966   - this.totalPrice = shopSumPrice - reduceMoney
967   - } else if (couponType === 2 && reduceMoney > 0) { // 折扣
968   - const useMoney = this.checkedPlatformCoupon.useMoney
969   - this.totalPrice = (shopSumPrice - useMoney) + useMoney * reduceMoney / 10
970   - }
971   - }
972   - // 积分支付计算
973   - this.calcCredit()
974   - // 加上每个商家的运费
975   - this.settlement.shops.forEach((item) => {
976   - this.totalPrice = this.totalPrice + (item.distribution.distributionPrice || 0)
977   - })
978   - //this.recalcHuabei()
979   - },
980   - calcCredit() {
981   - let shopsLen = this.settlement.shops.length
982   - const skuRemainMap = this.calcSkuRemainMap()
983   - const skuCreditMap = this.settlement.skuCreditMap;
984   - if (skuCreditMap && this.integralRatio > 0) {
985   - this.orderCreditThreshold = this.settlement.orderCreditThreshold
986   - let remainUserCredit = this.settlement.userTotalCredit
987   - let remainTotalPrice = Math.round((this.totalPrice + Number.EPSILON) * 100) / 100
988   - let remainDeductLimit = this.settlement.creditDeductLimit
989   - // 只有订单金额达到阈值,并且用户还有剩余的积分,才能进行积分抵扣
990   - if (this.totalPrice >= this.orderCreditThreshold && remainUserCredit > 0 && remainDeductLimit > 0) {
991   - for (let i = 0; i < shopsLen; i++) {
992   - const curShop = this.settlement.shops[i]
993   - let skuLen = curShop.skus.length
994   - for (let j = 0; j < skuLen; j++) {
995   - const curSku = curShop.skus[j]
996   - const skuId = curSku.skuId
997   - if (skuCreditMap[skuId] > 0 && skuRemainMap[skuId] > 0 && remainUserCredit > 0 &&
998   - remainTotalPrice > 0) {
999   - // 抵扣之后,必须保证整个订单至少还有0.01元,可用于支付
1000   - if (remainTotalPrice - skuRemainMap[skuId] < 0.01) {
1001   - skuRemainMap[skuId] -= 0.01
1002   - }
1003   - // 按照比例换算成需要多少积分抵扣(取整)
1004   - let finalSkuCredit = parseInt((skuRemainMap[skuId] / this.integralRatio).toString());
1005   - // 优先以商家配置的商品可抵扣积分为准
1006   - if (skuCreditMap[skuId] < finalSkuCredit) {
1007   - finalSkuCredit = skuCreditMap[skuId]
1008   - }
1009   - // 不能超过用户剩余积分
1010   - if (remainUserCredit < finalSkuCredit) {
1011   - finalSkuCredit = remainUserCredit
1012   - }
1013   - // 不能超过整个订单可抵扣积分
1014   - if (remainDeductLimit < finalSkuCredit) {
1015   - finalSkuCredit = remainDeductLimit
1016   - }
1017   - curSku.cachedCredit = finalSkuCredit
1018   - this.integralNum += finalSkuCredit
1019   - remainUserCredit -= finalSkuCredit
1020   - remainDeductLimit -= finalSkuCredit
1021   - remainTotalPrice -= finalSkuCredit
1022   - }
1023   - }
1024   - }
1025   - }
1026   - //计算抵扣价格
1027   - if (this.integralNum !== 0) {
1028   - this.integralNum = parseInt(this.integralNum)
1029   - this.integralPrice = this.integralNum * this.integralRatio
1030   - if (this.integralNum !== 0) {
1031   - this.integralShow = true
1032   - }
1033   - if (this.selectIntegral) {
1034   - this.totalPrice = this.totalPrice - this.integralPrice
1035   - }
1036   - } else {
1037   - this.integralShow = false
1038   - }
1039   - }
1040   - },
1041   - /**
1042   - * 计算sku在整个运单价格中的剩余价值 1元的订单,打1折优惠之后,剩余价值就是0.1元
1043   - */
1044   - calcSkuRemainMap() {
1045   - let skuRemainMap = {}
1046   - let shopsLen = this.settlement.shops.length
1047   - const skuCreditMap = this.settlement.skuCreditMap
1048   - for (let i = 0; i < shopsLen; i++) {
1049   - const curShop = this.settlement.shops[i]
1050   - let skuLen = curShop.skus.length
1051   - let checkedShopCoupon = undefined
1052   - curShop.shopCoupons.forEach((item) => {
1053   - if (item.checked) {
1054   - checkedShopCoupon = item
1055   - }
1056   - })
1057   - for (let j = 0; j < skuLen; j++) {
1058   - const curSku = curShop.skus[j]
1059   - const skuId = curSku.skuId
1060   - // 不是定价捆绑,并且有配置可抵扣的积分,才有必要计算比例
1061   - if (!curSku.priceId > 0 && skuCreditMap[skuId] > 0) {
1062   - let remainSkuMoney = curSku.price * curSku.number
1063   - if (checkedShopCoupon) {
1064   - let skuShopPercent = remainSkuMoney / curShop.total
1065   - let curReduceMoney = 0
1066   - if (checkedShopCoupon.couponType === 1) {
1067   - curReduceMoney = checkedShopCoupon.reduceMoney * skuShopPercent
1068   - } else {
1069   - curReduceMoney = remainSkuMoney * (10 - checkedShopCoupon.reduceMoney) / 10
1070   - }
1071   - remainSkuMoney = remainSkuMoney - curReduceMoney
1072   - }
1073   - // 使用平台券
1074   - if (this.checkedPlatformCoupon && remainSkuMoney > 0) {
1075   - // 满减
1076   - if (this.checkedPlatformCoupon.couponType === 1) {
1077   - let skuTotalPercent = remainSkuMoney / this.totalPrice
1078   - remainSkuMoney -= this.checkedPlatformCoupon.reduceMoney * skuTotalPercent
1079   - }
1080   - // 折扣
1081   - else {
1082   - remainSkuMoney = remainSkuMoney * this.checkedPlatformCoupon.reduceMoney / 10
1083   - }
1084   - }
1085   - skuRemainMap[skuId] = remainSkuMoney
1086   - }
1087   - }
1088   - }
1089   - return skuRemainMap
1090   - },
1091   - // 展示平台端优惠券
1092   - showDiscount() {
1093   - // let shopifAdd = 1
1094   - // if(this.settlement.shops[this.shopIndex].shopCoupons.length>0){
1095   - // shopifAdd = this.settlement.shops[this.shopIndex].shopCoupons[this.shopCouIndex].ifAdd
1096   - // }
1097   - if (this.settlement.coupons.length > 0) {
1098   - for (let i = 0; i < this.selectShopCoupon.length; i++) {
1099   - if (this.selectShopCoupon[i].ifAdd == 0) {
1100   - uni.showToast({
1101   - title: '不可叠加已选择的店铺券',
1102   - icon: 'none'
1103   - })
1104   - return false
1105   - }
1106   - }
1107   - this.isShowDiscount = true
1108   - } else {
1109   - uni.showToast({
1110   - title: '暂无可用优惠券',
1111   - icon: 'none'
1112   - })
1113   - }
1114   - },
1115   - // 显示店铺优惠券
1116   - showShopCoupons(item, sIndex) {
1117   - if (item.shopCoupons.length > 0) {
1118   - this.isShopCoupons = true
1119   - this.shopCouponslist = item
1120   - this.shopCouponsLength = item.shopCoupons.length
1121   - this.shopIndex = sIndex
1122   - } else {
1123   - uni.showToast({
1124   - title: '暂无可用优惠券',
1125   - icon: 'none'
1126   - })
1127   - }
1128   - },
1129   - onDiscountClose() {
1130   - this.isShowDiscount = false
1131   - },
1132   - onshopClose() {
1133   - this.isShopCoupons = false
1134   - },
1135   -
1136   -
1137   - /**
1138   - * 检查提交表单
1139   - * @return {boolean}
1140   - */
1141   - handleCheckOrderForm() {
1142   - if (!this.payObj.paymentMode) {
1143   - uni.showToast({
1144   - title: '请选择支付方式',
1145   - icon: 'none'
1146   - })
1147   - return false
1148   - }
1149   - if (!this.oneClickSubmit) {
1150   - uni.showToast({
1151   - title: "已提交,请勿重新操作!",
1152   - icon: 'none'
1153   - })
1154   - return false
1155   - }
1156   - if (!this.userAddressInfo.receiveName) {
1157   - uni.showToast({
1158   - icon: 'none',
1159   - title: '请选择收货地址'
1160   - })
1161   - return false
1162   - }
1163   - this.oneClickSubmit = false
1164   - return true
1165   - },
1166   -
1167   - /**
1168   - * 支付更改事件
1169   - * @param params
1170   - */
1171   - handleChangeCashier(params){
1172   - this.payObj = params
1173   - console.log(params)
1174   - },
1175   -
1176   - /**
1177   - * 组装结算数据
1178   - */
1179   - handlePackageData() {
1180   - uni.showLoading({
1181   - mask: true,
1182   - title: '订单提交中...',
1183   - })
1184   - let couponIdinfo = 0
1185   - if (this.promotionInfoDTO.couponId) {
1186   - couponIdinfo = this.promotionInfoDTO.couponId
1187   - }
1188   - let data = {
1189   - shopDiscountId: null,
1190   - collageId: this.collageId,
1191   - type: this.sumitType,
1192   - shopGroupWorkId: null,
1193   - receiveId: this.receiveId,
1194   - couponId: couponIdinfo,
1195   - price: this.totalPrice,
1196   - remark: "",
1197   - shops: [],
1198   - discountPrice: this.discountPrice,
1199   - shopSeckillId: null
1200   - }
1201   -
1202   - if (this.shopGroupWorkId > 0) {
1203   - data.shopGroupWorkId = this.shopGroupWorkId
1204   - }
1205   -
1206   - if (this.skuItemDTOList != '') {
1207   - if (this.skuItemDTOList[0].shopDiscountId > 0) {
1208   - data.shopDiscountId = this.skuItemDTOList[0].shopDiscountId
1209   - } else if (this.skuItemDTOList[0].shopSeckillId > 0) {
1210   - data.shopSeckillId = this.skuItemDTOList[0].shopSeckillId
1211   - }
1212   - }
1213   - let datashopslen = this.settlement.shops.length
1214   - for (let n = 0; n < datashopslen; n++) {
1215   - let shopsobj = {}
1216   - shopsobj["shopId"] = this.settlement.shops[n].shopId
1217   - shopsobj["sceneId"] = this.settlement.shops[n].sceneId
1218   - shopsobj["distribution"] = {}
1219   - shopsobj["skus"] = []
1220   - if (this.settlement.shops[n].currentCoupon) {
1221   - shopsobj["id"] = this.settlement.shops[n].currentCoupon.id
1222   - }
1223   - data.shops.push(shopsobj)
1224   - data.shops[n].distribution.distributionPrice = this.settlement.shops[n].distribution.distributionPrice
1225   - data.shops[n].distribution.distributionName = this.settlement.shops[n].distribution.distributionName
1226   - let dataskuslen = this.settlement.shops[n].skus.length
1227   - for (let m = 0; m < dataskuslen; m++) {
1228   - let skusobj = {}
1229   - const curSku = this.settlement.shops[n].skus[m]
1230   - skusobj["skuId"] = curSku.skuId
1231   - skusobj["number"] = curSku.number
1232   - skusobj["ifLogistics"] = curSku.ifLogistics
1233   - skusobj["selected"] = curSku.selected
1234   - skusobj["platformSeckillId"] = curSku.platformSeckillId
1235   - skusobj["platformDiscountId"] = curSku.platformDiscountId
1236   - skusobj["shopSeckillId"] = curSku.shopSeckillId
1237   - skusobj["shopDiscountId"] = curSku.shopDiscountId
1238   - skusobj["sceneId"] = curSku.sceneId
1239   - skusobj["priceId"] = curSku.priceId
1240   - skusobj["useMember"] = curSku.useMember
1241   - skusobj["composeId"] = curSku.composeId
1242   - // 处理埋点id
1243   - this.pointProductIds += curSku.productId + ','
1244   - // 积分传参
1245   - if (this.selectIntegral && curSku.cachedCredit) {
1246   - skusobj["useCredit"] = curSku.cachedCredit
1247   - skusobj["useCreditAmount"] = (curSku.cachedCredit * this.integralRatio).toFixed(2)
1248   - }
1249   - data.shops[n].skus.push(skusobj)
1250   - }
1251   - }
1252   -
1253   - // 去除最后一个,
1254   - if (this.pointProductIds.endsWith(',')) {
1255   - this.pointProductIds = this.pointProductIds.slice(0, -1)
1256   - }
1257   - this.handleSetPayMode(data)
1258   - uni.hideLoading()
1259   - return data
1260   - },
1261   -
1262   - /**
1263   - * 根据环境设置下单的支付信息
1264   - * @param data handlePackageData返回值
1265   - */
1266   - handleSetPayMode(data){
1267   - // subPaymentMode 1-小程序支付 2-app支付 3-H5支付
1268   - // paymentMode 1-微信 2-支付宝
1269   - data.paymentMode = this.payObj.paymentMode
1270   - // #ifdef H5
1271   - data.subPaymentMode = 3
1272   - // #endif
1273   -
1274   - // #ifdef MP-WEIXIN
1275   - data.subPaymentMode = 1
1276   - // #endif
1277   -
1278   - // #ifdef APP-PLUS
1279   - data.paymentMode = 1
1280   - // #endif
1281   - // #ifdef MP-ALIPAY
1282   - data.subPaymentMode = 2
1283   - // #endif
1284   - },
1285   - /**
1286   - * 提交订单
1287   - * @return {Promise<void>}
1288   - */
1289   - async submitOrder() {
1290   - if (!this.handleCheckOrderForm()) return;
1291   - // 处理表单
1292   - const data = this.handlePackageData()
1293   - uni.showLoading({
1294   - mask: true,
1295   - title: '结算中...',
1296   - })
1297   - try {
1298   - console.log('结算中结算中结算中结算中结算中结算中',data)
1299   - const res = await NET.request(API.PlaceOrder, data, 'POST')
1300   - // 下单成功处理埋点
1301   - this.$store.dispatch('doPointer', {
1302   - eventType: 3,
1303   - productIds: this.pointProductIds
1304   - })
1305   - if (this.type == 2) {
1306   - let carSkusData = data.shops
1307   - let dataList = uni.getStorageSync('dataList')
1308   - let ids = []
1309   - for (const shopObj of dataList) {
1310   - ids = [...ids, ...shopObj.skus.filter(sku => (sku.selected === 1 || sku.selected === true)).map(sku => sku.skuId)]
1311   - }
1312   - await NET.request(API.DeleteCart, {ids}, 'POST')
1313   - let skusArr = []
1314   - for (let i = 0; i < carSkusData.length; i++) {
1315   - carSkusData[i].skus.map(item => {
1316   - skusArr.push(item.skuId)
1317   - })
1318   - }
1319   - }
1320   - let submitResult = res.data
1321   - this.orderId = res.data.orderId
1322   - submitResult.type = 1
1323   - submitResult.paymentMode = data.paymentMode
1324   - if(this.payObj.paymentMode && this.payObj.huabeiPeriod){
1325   - submitResult.huabeiPeriod = this.payObj.huabeiPeriod
1326   - }
1327   - await handleDoPay.call(this, submitResult)
  319 + import {
  320 + hidden
  321 + } from "../../utils/hidden";
  322 + import {
  323 + handleDoPay
  324 + } from "../../utils/payUtil";
  325 +
  326 + const NET = require('../../utils/request')
  327 + const API = require('../../config/api')
  328 + import CashierList from "../../components/CashierList";
  329 + export default {
  330 + components: {
  331 + CashierList
  332 + },
  333 + data() {
  334 + return {
  335 + // 埋点ID
  336 + pointProductIds: '',
  337 + couponActiveShowFalg: false,
  338 + settlement: {},
  339 + type: 0,
  340 + skuItemDTOList: [],
  341 + userAddressInfo: {},
  342 + isShowDiscount: false,
  343 + isShopCoupons: false,
  344 + usableListLength: 0,
  345 + shopCouponsLength: 0,
  346 + shopCouponslist: [],
  347 + promotionInfoDTO: {
  348 + couponId: 0,
  349 + ifAdd: 1,
  350 + reduceMoney: 0
  351 + },
  352 + shopInfoDTO: {},
  353 + reduceMoney: 0,
  354 + submitActive: true,
  355 + distributionPrice: 0, //运费
  356 + totalPrice: 0, //合计
  357 + receiveId: '',
  358 + totalCount: 0,
  359 + skuItemList: {},
  360 + shopGroupWorkId: 0,
  361 + sumitType: '',
  362 + collageId: null,
  363 + couponIfAdd: true,
  364 + couponsList: [],
  365 + shopCouIndex: 0, //优惠券index
  366 + shopIndex: 0,
  367 + shopCheckedType: true,
  368 + discountPrice: 0,
  369 + selectShopCoupon: [], // 已选择店铺优惠券
  370 + huabeiDetail: true,
  371 + showHuabeiPopup: false,
  372 + huabeiChargeType: 0,
  373 + huabeiFeerateList: [],
  374 + paymentMode: 0, //支付方式 1-微信支付 2-支付宝支付 3-花呗分期
  375 + huabeiPeriod: 3, //选择的花呗分期数 有 3 6 12 3种选项,默认是3
  376 + chargeFeeList: [], //花呗每期的手续费
  377 + fenqiFeeList: [], //花呗每期的支付额
  378 + showWechatPayType: false,
  379 + showAlipayPayType: false,
  380 + showHuabeiPayType: false,
  381 + orderId: null,
  382 + couponType: 0,
  383 + selectIntegral: true,
  384 + integralNum: 0,
  385 + ifShow: false,
  386 + integralRatio: 0, // 积分兑换比例
  387 + integralPrice: 0, // 总积分可减多少元
  388 + orderCreditThreshold: 0, // 满多少元可以抵扣
  389 + integralShow: false, // 显示隐藏积分
  390 + checkedPlatformCoupon: undefined,
  391 + oneClickSubmit: true, //只提交订单一次
  392 + isRegionalScope: false, //是否在商家配置范围内地址
  393 + payObj: {}, // 支付相关
  394 + couponList:[],
  395 + iscoupon:false,
  396 + couponId:{},
  397 + ptyh:0
  398 + }
  399 + },
  400 + onLoad(options) {
  401 + this.getQuery()
  402 + console.log(options, 'options')
  403 + this.type = options.type
  404 + if (options.receiveId) {
  405 + this.receiveId = options.receiveId
  406 + }
  407 + },
  408 + onShow() {
  409 + if (uni.getStorageSync("receiveItem")) {
  410 + this.receiveId = uni.getStorageSync("receiveItem").receiveId
  411 + }
  412 + if (uni.getStorageSync("skuItemDTOList") != "") {
  413 + this.skuItemDTOList = uni.getStorageSync('skuItemDTOList')
  414 + console.log(this.skuItemDTOList, '66666')
  415 + if (this.skuItemDTOList[0].shopDiscountId > 0) {
  416 + this.sumitType = 4
  417 + } else if (this.skuItemDTOList[0].shopSeckillId > 0) {
  418 + this.sumitType = 3
  419 + }
  420 + this.getSettlement(false)
  421 + } else if (uni.getStorageSync("skuItemList") != "") {
  422 + this.skuItemList = uni.getStorageSync("skuItemList")
  423 + //console.log(this.skuItemList, 999)
  424 + this.shopGroupWorkId = this.skuItemList.shopGroupWorkId
  425 + this.sumitType = this.skuItemList.type
  426 + this.collageId = this.skuItemList.collageId
  427 + this.getSettlement(true)
  428 + }
  429 +
  430 + },
  431 + onBackPress(e) {
  432 + if (e.from === 'navigateBack') {
  433 + return false;
  434 + }
  435 + this.back();
  436 + return true
  437 + },
  438 + filters: {
  439 + clip2Decimal(value) {
  440 + if (value === undefined || value === null) {
  441 + return "0.00"
  442 + }
  443 + return (parseInt(value * 100) / 100).toFixed(2)
  444 + }
  445 + },
  446 + methods: {
  447 + changecoupon() {
  448 + this.iscoupon = true
  449 + this.getcon()
  450 + },
  451 + getcon() {
  452 + let that = this
  453 + NET.request(API.couponnew, {
  454 + page: 1,
  455 + pageSize: 10,
  456 + userId: uni.getStorageSync('storage_key').buyerUserId
  457 + }, 'POST').then(res => {
  458 + if(res.data.length>0) {
  459 + this.couponList = []
  460 + let c1list1 = []
  461 + let c1list2 = []
  462 +
  463 + res.data.forEach((e) => {
  464 + if(e.coupon.couponStatus == '2') {
  465 + let numall = 0
  466 + e.istrue = true
  467 + // let istrue = false
  468 + if(e.cereCouponCategories.length>0) {
  469 + let num = that.settlement.shops.length
  470 + for (let i = 0; i < e.cereCouponCategories.length; i++) {
  471 + let c1 = e.cereCouponCategories[i]
  472 + if(c1.usedMerchants == '3'){
  473 + // 商家
  474 + for (let n = 0; n < num; n++) {
  475 + let c2 = that.settlement.shops[n]
  476 + c2.skus.forEach(item=>{
  477 + numall = numall + (item.price*item.number)
  478 + })
  479 + if(c2.shopId != c1.categoryId){
  480 + e.istrue = false
  481 + }
  482 + }
  483 + }
  484 + if(c1.usedMerchants == '1'){
  485 + // 类别
  486 + for (let n = 0; n < num; n++) {
  487 + let c2 = this.settlement.shops[n]
  488 + c2.skus.forEach(item=>{
  489 + if(item.categoryId != c1.categoryId){
  490 + e.istrue = false
  491 + numall = numall + (item.price*item.number)
  492 + }
  493 + })
  494 + }
  495 + }
  496 + }
  497 + }
  498 + console.error(numall,e.usageThreshold)
  499 + if(e.couponType == '1') {
  500 + if(numall >= e.usageThreshold) {
  501 +
  502 + } else {
  503 + e.istrue = false
  504 + console.error('满减不够')
  505 + // 满减不够
  506 + // uni.showToast({
  507 + // icon:"none",
  508 + // title:'满减不够'
  509 + // })
  510 + }
  511 +
  512 + }
  513 + if(e.istrue) {
  514 + c1list1.push(e)
  515 + } else {
  516 + c1list2.push(e)
  517 + }
  518 + }
  519 + // this.couponList.push(e)
  520 + })
  521 + this.couponList = [
  522 + ...c1list1,
  523 + ...c1list2
  524 + ]
  525 + this.couponList.forEach((item) => {
  526 + item.checked = false
  527 + item.usedMerchants = '1'
  528 + })
  529 + // this.couponId = this.couponList[3]
  530 +
  531 + // console.error(this.couponList)
  532 + }
  533 +
  534 + })
  535 + },
  536 + changemony() {
  537 + console.error(this.couponId)
  538 + let type = null
  539 + if(this.couponId.id) {
  540 + if(this.couponId.useCategory == '1' && this.couponId.usedMerchants == '1') {
  541 + console.log('直接使用平台券')
  542 + type = '1'
  543 + } else if(this.couponId.useCategory == '1' && this.couponId.usedMerchants == '3') {
  544 + console.log('限制商家id')
  545 + type = '2'
  546 + } else if(this.couponId.useCategory == '2' && this.couponId.usedMerchants == '3') {
  547 + console.log('限制商家id类别')
  548 + type = '3'
  549 + } else if(this.couponId.useCategory == '2' && this.couponId.usedMerchants == '1') {
  550 + console.log('限制类别')
  551 + type = '4'
  552 + }
  553 + }
  554 + type = 2
  555 + let num = 0
  556 + console.error(this.settlement.shops)
  557 + for (let i = 0; i < this.couponId.cereCouponCategories.length; i++) {
  558 + let c1 = this.couponId.cereCouponCategories[i]
  559 + if(c1.usedMerchants == '3'){
  560 + // 商家
  561 + for (let n = 0; n < this.settlement.shops.length; n++) {
  562 + let c2 = this.settlement.shops[n]
  563 + if(c2.shopId == c1.categoryId){
  564 + console.error('===')
  565 + for (let u = 0; u < c2.skus.length; u++) {
  566 + console.error(c2.skus[u].price)
  567 + num = num + (c2.skus[u].price*c2.skus[u].number)
  568 + }
  569 + }
  570 + }
  571 + }
  572 + if(c1.usedMerchants == '1'){
  573 + for (let n = 0; n < this.settlement.shops.length; n++) {
  574 + let c2 = this.settlement.shops[n]
  575 + for (let u = 0; u < c2.skus.length; u++) {
  576 + console.error(c2.skus[u].price)
  577 + if(c2.skus[u].categoryId == c1.categoryId){
  578 + num = num + (c2.skus[u].price*c2.skus[u].number)
  579 + }
  580 +
  581 + }
  582 + }
  583 + }
  584 + }
  585 + console.error('可以优惠的金额',num)
  586 + let numr = 0
  587 + if(this.couponId.couponType == '1') {
  588 + if(num >= this.couponId.usageThreshold) {
  589 + numr = this.couponId.discountContent
  590 + } else {
  591 + // 满减不够
  592 + uni.showToast({
  593 + icon:"none",
  594 + title:'满减不够'
  595 + })
  596 + }
  597 +
  598 + } else {
  599 + if((num*(1-(this.couponId.discountContent/10))) >= this.couponId.maxDiscountAmount) {
  600 + numr = this.couponId.maxDiscountAmount
  601 + // 超出
  602 + } else {
  603 + let asd = num*(1-(this.couponId.discountContent/10))
  604 + numr = asd.toFixed(2)
  605 + }
  606 + }
  607 + this.ptyh = numr
  608 + console.error(numr)
  609 + },
  610 + getQuery() {
  611 + NET.request(API.Query, {
  612 + name: 'credit_exchange_rate'
  613 + }, 'GET').then(res => {
  614 + this.integralRatio = parseFloat(res.data.dictDescribe)
  615 + }).catch(res => {
  616 + console.log('平台端未配置积分兑换比例(1积分抵扣多少金额)')
  617 + })
  618 + },
  619 + // 积分价格计算
  620 + changeIntegral() {
  621 + this.selectIntegral = !this.selectIntegral
  622 + if (this.selectIntegral) {
  623 + this.totalPrice = this.totalPrice - this.integralPrice
  624 + } else {
  625 + this.totalPrice = this.totalPrice + this.integralPrice
  626 + }
  627 + },
  628 + back() {
  629 + if (this.type == 2 || this.type) {
  630 + uni.switchTab({
  631 + url: '../../pages/tabbar/cart/index'
  632 + })
  633 + } else {
  634 + uni.navigateBack({
  635 + delta: 1
  636 + });
  637 + }
  638 + },
  639 + // 获取订单信息
  640 + getSettlement(isGroup) {
  641 + uni.showLoading({
  642 + title: '加载中...',
  643 + })
  644 + this.ifShow = true
  645 + let _url = '',
  646 + _data = ''
  647 + // 是否是拼团
  648 + if (isGroup) {
  649 + _url = API.getGroupSettlement
  650 + _data = this.skuItemList
  651 + } else {
  652 + _url = API.Settlement
  653 + _data = {
  654 + type: this.type,
  655 + shops: this.skuItemDTOList,
  656 + receiveId: this.receiveId
  657 + }
  658 + // composeId: 68
  659 + console.log(this.skuItemDTOList, 'this.skuItemDTOList')
  660 + }
  661 + console.error(JSON.stringify(_data))
  662 + NET.request(_url, _data, 'POST').then(res => {
  663 + uni.hideLoading()
  664 + this.settlement = res.data
  665 + this.couponsList = res.data.coupons
  666 + this.huabeiChargeType = res.data.huabeiChargeType
  667 + if (this.huabeiChargeType === 2) {
  668 + this.huabeiFeerateList = res.data.huabeiFeerateList
  669 + } else {
  670 + this.huabeiFeerateList = [0, 0, 0]
  671 + }
  672 + let shopLen = this.settlement.shops.length
  673 + this.settlement.shops.forEach((value) => {
  674 + value['totalNum'] = value.total
  675 + value['pricing'] = 0
  676 + })
  677 + // 如果没有地址时进入购买宝贝页面对下面的商品件数和总计进行赋值
  678 + if (!this.settlement.receive.receiveAdress) {
  679 + this.settlement.shops.map(item => {
  680 + this.totalCount += item.number
  681 + this.totalPrice += item.total || item.totalNum
  682 + })
  683 + }
  684 + // 初始化平台券选中状态
  685 + if (this.settlement.coupons.length > 0) {
  686 + this.settlement.coupons.forEach((item) => {
  687 + item.checked = false
  688 + })
  689 + }
  690 + this.settlement.shops.forEach((item) => {
  691 + item.totalAfterDiscount = item.total
  692 + })
  693 + // 默认选中商家的第一张优惠券
  694 + for (let s = 0; s < shopLen; s++) {
  695 + const curShop = this.settlement.shops[s]
  696 + curShop.skus.forEach((item) => {
  697 + item['skuTotalNum'] = item.total
  698 + })
  699 + if (curShop.shopCoupons.length > 0) {
  700 + curShop.shopCoupons.forEach((item) => {
  701 + item.checked = false
  702 + })
  703 + const firstShopCoupon = curShop.shopCoupons[0];
  704 + this.shopCouponItemTap(0, firstShopCoupon)
  705 +
  706 + /*let useCoupon = this.useShopCoupon(s, 0)
  707 + if (useCoupon) {
  708 + firstShopCoupon.checked = true
  709 + this.selectShopCoupon.push(firstShopCoupon)
  710 + curShop['currentCoupon'] = firstShopCoupon
  711 + } else {
  712 + curShop.totalNum = curShop.total
  713 + }*/
  714 + }
  715 + }
  716 +
  717 + if (uni.getStorageSync('receiveItem')) {
  718 + let receiveItem = uni.getStorageSync('receiveItem')
  719 + this.userAddressInfo = receiveItem
  720 + this.receiveId = receiveItem.receiveId
  721 + this.userAddressInfo.receivePhone = hidden(this.userAddressInfo.receivePhone, 3, 4)
  722 + } else if (res.data.receive) {
  723 + this.receiveId = res.data.receive.receiveId
  724 + this.userAddressInfo = res.data.receive
  725 + this.userAddressInfo.receivePhone = hidden(this.userAddressInfo.receivePhone, 3, 4)
  726 + }
  727 + uni.removeStorageSync('receiveItem')
  728 + this.usableListLength = res.data.coupons.length
  729 + this.isReceiveCan()
  730 + this.getTotal()
  731 + }).catch(res => {
  732 + uni.hideLoading()
  733 + })
  734 + },
  735 + // 根据地址判断是否能下单
  736 + isReceiveCan() {
  737 + this.settlement.shops.map(item => {
  738 + if (item.receiveNotMatch) {
  739 + this.isRegionalScope = item.receiveNotMatch
  740 + }
  741 + if (this.isRegionalScope) {
  742 + uni.showToast({
  743 + title: '当前地址不支持配送,请参与红色字提示',
  744 + icon: 'none'
  745 + })
  746 + }
  747 + })
  748 + },
  749 +
  750 + addAddressTap() {
  751 + uni.navigateTo({
  752 + url: '../../pages_category_page2/userModule/address?type=' + this.type,
  753 + })
  754 + },
  755 + getDate(time) {
  756 + if (!time) return '';
  757 + return time.split(' ')[0]
  758 + },
  759 + // 平台优惠券选择
  760 + couponItemTap(index, coupon) {
  761 + if (!coupon.checked && this.selectShopCoupon.length) { // 判断商家券情况
  762 + uni.showToast({
  763 + title: '不可与商家券叠加使用!',
  764 + icon: 'none'
  765 + })
  766 + return false
  767 + }
  768 + // 已选中的情况下取消选中
  769 + if (coupon.checked) {
  770 + let promotionInfoDTO = {}
  771 + if (coupon.couponId) {
  772 + promotionInfoDTO['couponId'] = 0
  773 + promotionInfoDTO['ifAdd'] = 1
  774 + promotionInfoDTO['reduceMoney'] = 0
  775 + }
  776 + this.promotionInfoDTO = promotionInfoDTO
  777 + coupon.checked = false
  778 + this.isShowDiscount = false
  779 + this.checkedPlatformCoupon = undefined
  780 + this.settlement.shops.forEach(shopItem => {
  781 + if (shopItem.skus) {
  782 + shopItem.skus.forEach(skuItem => {
  783 + skuItem.buyerCouponId = null
  784 + })
  785 + }
  786 + })
  787 + this.getTotal()
  788 + } else {
  789 + // 先把所有已选中的平台优惠券改为未选中
  790 + this.settlement.coupons.forEach((item) => {
  791 + item.checked = false
  792 + })
  793 + let totalPrice = 0 // 订单总价
  794 + let shopsLen = this.settlement.shops.length // 结算页店铺数量
  795 + let matchCouponSkuList = []
  796 + for (let i = 0; i < shopsLen; i++) {
  797 + let matchCouponNormalPrice = 0
  798 + let priceCount = 0
  799 + const curShop = this.settlement.shops[i]
  800 + let skuLen = curShop.skus.length
  801 + let tmpPriceSkuList = []
  802 + for (let j = 0; j < skuLen; j++) {
  803 + const curSku = curShop.skus[j]
  804 + if (curSku.priceId > 0) {
  805 + priceCount++
  806 + }
  807 + const ids = coupon.ids
  808 + if (ids.indexOf(curSku.productId) > -1) {
  809 + if (curSku.priceId > 0) {
  810 + tmpPriceSkuList.push(curSku)
  811 + } else {
  812 + matchCouponSkuList.push(curSku)
  813 + matchCouponNormalPrice = matchCouponNormalPrice + curSku.price * curSku.number
  814 + }
  815 + }
  816 + }
  817 + if (priceCount === tmpPriceSkuList.length) {
  818 + totalPrice += curShop.priceAfterDiscount
  819 + matchCouponSkuList = matchCouponSkuList.concat(tmpPriceSkuList)
  820 + }
  821 + totalPrice += matchCouponNormalPrice
  822 + }
  823 + if (this.settlement.shops[this.shopIndex].total < coupon.fullMoney) {
  824 + uni.showToast({
  825 + title: '不满足优惠券使用条件!',
  826 + icon: 'none'
  827 + })
  828 + return false
  829 + }
  830 + if (coupon.couponType === 1 && coupon.reduceMoney >= totalPrice) {
  831 + uni.showToast({
  832 + title: '不可使用大于等于合计金额的优惠劵!',
  833 + icon: 'none'
  834 + })
  835 + return false
  836 + }
  837 + // 如果是折扣券,需要记录,在什么基数上打折
  838 + coupon.useMoney = totalPrice
  839 + let promotionInfoDTO = {}
  840 + if (coupon.couponId) {
  841 + promotionInfoDTO['couponId'] = coupon.couponId
  842 + promotionInfoDTO['ifAdd'] = coupon.ifAdd
  843 + promotionInfoDTO['couponType'] = coupon.couponType
  844 + promotionInfoDTO['reduceMoney'] = coupon.reduceMoney
  845 + }
  846 + this.promotionInfoDTO = promotionInfoDTO
  847 + this.isShowDiscount = false
  848 + this.checkedPlatformCoupon = coupon
  849 + matchCouponSkuList.forEach(item => {
  850 + item.buyerCouponId = coupon.couponId
  851 + })
  852 + this.getTotal()
  853 + // 选中优惠券
  854 + coupon.checked = true
  855 + }
  856 + },
  857 + couponcouponList(index, coupon) {
  858 + if(!coupon.istrue) {
  859 + uni.showToast({
  860 + icon:"none",
  861 + title:'当前优惠券无法使用'
  862 + })
  863 + return
  864 + }
  865 + for (let i = 0; i < this.couponList.length; i++) {
  866 + this.couponList[i].ischecked = false
  867 + }
  868 + this.couponList[index].ischecked = true
  869 + this.couponId = this.couponList[index]
  870 + this.changemony()
  871 + this.$forceUpdate()
  872 + this.iscoupon=false
  873 +
  874 +
  875 + // console.log(index)
1328 876  
1329   - } catch (e) {
1330   - this.oneClickSubmit = true
1331   - uni.showToast({
1332   - title: '订单结算错误',
1333   - icon: 'none'
1334   - })
1335   - } finally {
1336   - uni.hideLoading()
1337   - }
1338   - }
1339   -
1340   - }
1341   -}
  877 + },
  878 +
  879 + // 店铺优惠券选择
  880 + shopCouponItemTap(index, coupon) {
  881 + console.log(index, coupon.checked)
  882 + // 取消选择优惠券
  883 + if (coupon.checked) {
  884 + coupon.checked = false
  885 + this.settlement.shops[this.shopIndex].totalAfterDiscount = this.settlement.shops[this.shopIndex].total
  886 + this.settlement.shops[this.shopIndex].currentCoupon = {}
  887 + this.settlement.shops[this.shopIndex].skus.forEach(item => {
  888 + item.buyerShopCouponId = null
  889 + })
  890 + this.isShopCoupons = false
  891 + this.selectShopCoupon = []
  892 + this.getTotal()
  893 + return false
  894 + }
  895 + if (this.settlement.shops[this.shopIndex].total < coupon.fullMoney) {
  896 + uni.showToast({
  897 + title: '不满足优惠券使用条件!',
  898 + icon: 'none'
  899 + })
  900 + } else if (coupon.couponType === 1 && this.settlement.shops[this.shopIndex].total < coupon.reduceMoney) {
  901 + uni.showToast({
  902 + title: '不可使用大于商品金额的优惠劵!',
  903 + icon: 'none'
  904 + })
  905 + } else {
  906 + // 选择优惠券
  907 + if (this.promotionInfoDTO.couponId !== 0) {
  908 + uni.showToast({
  909 + title: '此券不可与平台券叠加!',
  910 + icon: 'none'
  911 + })
  912 + return false
  913 + }
  914 + if (coupon.couponType === 1) {
  915 + if (coupon.reduceMoney >= this.settlement.shops[this.shopIndex].total) {
  916 + uni.showToast({
  917 + title: '优惠券优惠金额不能大于等于合计金额!',
  918 + icon: 'none'
  919 + })
  920 + return false
  921 + }
  922 + }
  923 +
  924 + this.isShopCoupons = false
  925 + let useCoupon = this.useShopCoupon(this.shopIndex, index)
  926 + console.log(useCoupon)
  927 + if (useCoupon) {
  928 + // 确认使用当前点击的商家券,先将所有的商家券取消选中
  929 + for (let i = 0; i < this.selectShopCoupon.length; i++) {
  930 + this.selectShopCoupon[i].checked = false
  931 + }
  932 + this.selectShopCoupon = []
  933 +
  934 + coupon.checked = true
  935 + this.settlement.shops[this.shopIndex].currentCoupon = coupon
  936 + this.settlement.shops[this.shopIndex].skus.forEach(item => {
  937 + if (item.buyerShopCouponId > 0 && item.buyerShopCouponId !== coupon.shopCouponId) {
  938 + item.buyerShopCouponId = null
  939 + }
  940 + })
  941 + this.selectShopCoupon.push(coupon)
  942 + } else {
  943 + this.settlement.shops[this.shopIndex].totalAfterDiscount = this.settlement.shops[this.shopIndex]
  944 + .total
  945 + }
  946 + this.getTotal()
  947 + }
  948 + },
  949 + useShopCoupon(shopIndex, couponIndex) {
  950 + const curShop = this.settlement.shops[shopIndex]
  951 + curShop.totalAfterDiscount = 0
  952 + let curCoupon
  953 + if (curShop.shopCoupons && curShop.shopCoupons.length > 0) {
  954 + curCoupon = curShop.shopCoupons[couponIndex]
  955 + }
  956 + if (!curCoupon) {
  957 + return false
  958 + }
  959 + let useCoupon = false
  960 + let matchCouponNormalSkuList = []
  961 + let matchCouponPriceSkuList = []
  962 + if (curCoupon.applyType !== 1) {
  963 + const ids = curCoupon.ids
  964 + let skuLength = curShop.skus.length
  965 + // 符合优惠券商品列表中的普通sku价格综合
  966 +
  967 + let matchCouponNormalPrice = 0
  968 + // 符合定价捆绑且在优惠券商品列表中的价格综合
  969 + let matchCouponPricePrice = 0
  970 + // 符合定价捆绑活动的sku数量
  971 + let priceCount = 0
  972 + for (let idx = 0; idx < skuLength; idx++) {
  973 + let curSku = curShop.skus[idx]
  974 + if (curSku.priceId > 0) {
  975 + priceCount++
  976 + }
  977 + if (ids.indexOf(curSku.productId) > -1) {
  978 + if (curSku.priceId > 0) {
  979 + matchCouponPriceSkuList.push(curSku)
  980 + } else {
  981 + matchCouponNormalSkuList.push(curSku)
  982 + matchCouponNormalPrice = matchCouponNormalPrice + curSku.price * curSku.number
  983 + }
  984 + }
  985 + }
  986 + // 如果定价捆绑的所有sku都符合优惠券
  987 + if (priceCount === matchCouponPriceSkuList.length) {
  988 + matchCouponPricePrice = curShop.priceAfterDiscount
  989 + }
  990 + // 符合的sku的price加起来是否满足满减的条件
  991 + const priceFinal = matchCouponPricePrice + matchCouponNormalPrice
  992 + if (priceFinal < curCoupon.fullMoney || (curCoupon.couponType === 1 && priceFinal <= curCoupon
  993 + .reduceMoney)) {
  994 + return false
  995 + }
  996 + // 判断是满减,还是折扣
  997 + if (curCoupon.couponType === 1) {
  998 + curShop.totalAfterDiscount = curShop.total - curCoupon.reduceMoney
  999 + useCoupon = true
  1000 + } else {
  1001 + // 打折后优惠抵扣的金额
  1002 + let priceDiscount = (priceFinal * ((10 - curCoupon.reduceMoney) / 10)).toFixed(2)
  1003 + let tmpTotal = curShop.total - priceDiscount
  1004 + if (tmpTotal.toFixed(2) >= 0.01) {
  1005 + curShop.totalAfterDiscount = tmpTotal.toFixed(2)
  1006 + useCoupon = true
  1007 + }
  1008 + }
  1009 + if (useCoupon) {
  1010 + // 满足的sku设置buyerShopCouponId
  1011 + if (priceCount === matchCouponPriceSkuList.length) {
  1012 + let length1 = matchCouponPriceSkuList.length
  1013 + for (let idx = 0; idx < length1; idx++) {
  1014 + matchCouponPriceSkuList[idx].buyerShopCouponId = curCoupon.shopCouponId
  1015 + }
  1016 + }
  1017 + let length2 = matchCouponNormalSkuList.length
  1018 + for (let idx = 0; idx < length2; idx++) {
  1019 + matchCouponNormalSkuList[idx].buyerShopCouponId = curCoupon.shopCouponId
  1020 + }
  1021 + }
  1022 + } else {
  1023 + if (curCoupon.couponType === 1) {
  1024 + if (curShop.total > curCoupon.reduceMoney) {
  1025 + curShop.totalAfterDiscount = curShop.total - curCoupon.reduceMoney
  1026 + useCoupon = true
  1027 + }
  1028 + } else {
  1029 + if (curShop.total > curCoupon.fullMoney) {
  1030 + let priceDiscount = (curShop.total * ((10 - curCoupon.reduceMoney) / 10)).toFixed(2)
  1031 + let tmpTotal = curShop.total - priceDiscount
  1032 + if (tmpTotal.toFixed(2) >= 0.01) {
  1033 + curShop.totalAfterDiscount = tmpTotal.toFixed(2)
  1034 + useCoupon = true
  1035 + }
  1036 + }
  1037 + }
  1038 + if (useCoupon) {
  1039 + let skuLength = curShop.skus.length
  1040 + for (let idx = 0; idx < skuLength; idx++) {
  1041 + curShop.skus[idx].buyerShopCouponId = curCoupon.shopCouponId
  1042 + }
  1043 + }
  1044 + }
  1045 + return useCoupon
  1046 + },
  1047 + /**
  1048 + * 计算总价,商家券的优惠计算,在调用本方法之前已经计算好在shops[].totalAfterDiscount
  1049 + */
  1050 + getTotal() {
  1051 + this.totalPrice = 0
  1052 + this.totalCount = 0
  1053 + this.integralPrice = 0
  1054 + this.integralNum = 0
  1055 + let shopSumPrice = 0
  1056 + let shopsLen = this.settlement.shops.length
  1057 + console.log(this.settlement, 'fsfsfs')
  1058 + for (let i = 0; i < shopsLen; i++) {
  1059 + this.totalPrice += parseFloat(this.settlement.shops[i].totalAfterDiscount)
  1060 + shopSumPrice += parseFloat(this.settlement.shops[i].totalAfterDiscount)
  1061 + this.totalCount += this.settlement.shops[i].number
  1062 + }
  1063 +
  1064 + if (this.checkedPlatformCoupon) {
  1065 + const couponType = this.checkedPlatformCoupon.couponType
  1066 + const reduceMoney = this.checkedPlatformCoupon.reduceMoney
  1067 + if (couponType === 1 && this.totalPrice - reduceMoney > 0) { // 满减
  1068 + this.totalPrice = shopSumPrice - reduceMoney
  1069 + } else if (couponType === 2 && reduceMoney > 0) { // 折扣
  1070 + const useMoney = this.checkedPlatformCoupon.useMoney
  1071 + this.totalPrice = (shopSumPrice - useMoney) + useMoney * reduceMoney / 10
  1072 + }
  1073 + }
  1074 + // 积分支付计算
  1075 + this.calcCredit()
  1076 + // 加上每个商家的运费
  1077 + this.settlement.shops.forEach((item) => {
  1078 + this.totalPrice = this.totalPrice + (item.distribution.distributionPrice || 0)
  1079 + })
  1080 + //this.recalcHuabei()
  1081 + },
  1082 + calcCredit() {
  1083 + let shopsLen = this.settlement.shops.length
  1084 + const skuRemainMap = this.calcSkuRemainMap()
  1085 + const skuCreditMap = this.settlement.skuCreditMap;
  1086 + if (skuCreditMap && this.integralRatio > 0) {
  1087 + this.orderCreditThreshold = this.settlement.orderCreditThreshold
  1088 + let remainUserCredit = this.settlement.userTotalCredit
  1089 + let remainTotalPrice = Math.round((this.totalPrice + Number.EPSILON) * 100) / 100
  1090 + let remainDeductLimit = this.settlement.creditDeductLimit
  1091 + // 只有订单金额达到阈值,并且用户还有剩余的积分,才能进行积分抵扣
  1092 + if (this.totalPrice >= this.orderCreditThreshold && remainUserCredit > 0 && remainDeductLimit > 0) {
  1093 + for (let i = 0; i < shopsLen; i++) {
  1094 + const curShop = this.settlement.shops[i]
  1095 + let skuLen = curShop.skus.length
  1096 + for (let j = 0; j < skuLen; j++) {
  1097 + const curSku = curShop.skus[j]
  1098 + const skuId = curSku.skuId
  1099 + if (skuCreditMap[skuId] > 0 && skuRemainMap[skuId] > 0 && remainUserCredit > 0 &&
  1100 + remainTotalPrice > 0) {
  1101 + // 抵扣之后,必须保证整个订单至少还有0.01元,可用于支付
  1102 + if (remainTotalPrice - skuRemainMap[skuId] < 0.01) {
  1103 + skuRemainMap[skuId] -= 0.01
  1104 + }
  1105 + // 按照比例换算成需要多少积分抵扣(取整)
  1106 + let finalSkuCredit = parseInt((skuRemainMap[skuId] / this.integralRatio).toString());
  1107 + // 优先以商家配置的商品可抵扣积分为准
  1108 + if (skuCreditMap[skuId] < finalSkuCredit) {
  1109 + finalSkuCredit = skuCreditMap[skuId]
  1110 + }
  1111 + // 不能超过用户剩余积分
  1112 + if (remainUserCredit < finalSkuCredit) {
  1113 + finalSkuCredit = remainUserCredit
  1114 + }
  1115 + // 不能超过整个订单可抵扣积分
  1116 + if (remainDeductLimit < finalSkuCredit) {
  1117 + finalSkuCredit = remainDeductLimit
  1118 + }
  1119 + curSku.cachedCredit = finalSkuCredit
  1120 + this.integralNum += finalSkuCredit
  1121 + remainUserCredit -= finalSkuCredit
  1122 + remainDeductLimit -= finalSkuCredit
  1123 + remainTotalPrice -= finalSkuCredit
  1124 + }
  1125 + }
  1126 + }
  1127 + }
  1128 + //计算抵扣价格
  1129 + if (this.integralNum !== 0) {
  1130 + this.integralNum = parseInt(this.integralNum)
  1131 + this.integralPrice = this.integralNum * this.integralRatio
  1132 + if (this.integralNum !== 0) {
  1133 + this.integralShow = true
  1134 + }
  1135 + if (this.selectIntegral) {
  1136 + this.totalPrice = this.totalPrice - this.integralPrice
  1137 + }
  1138 + } else {
  1139 + this.integralShow = false
  1140 + }
  1141 + }
  1142 + },
  1143 + /**
  1144 + * 计算sku在整个运单价格中的剩余价值 1元的订单,打1折优惠之后,剩余价值就是0.1元
  1145 + */
  1146 + calcSkuRemainMap() {
  1147 + let skuRemainMap = {}
  1148 + let shopsLen = this.settlement.shops.length
  1149 + const skuCreditMap = this.settlement.skuCreditMap
  1150 + for (let i = 0; i < shopsLen; i++) {
  1151 + const curShop = this.settlement.shops[i]
  1152 + let skuLen = curShop.skus.length
  1153 + let checkedShopCoupon = undefined
  1154 + curShop.shopCoupons.forEach((item) => {
  1155 + if (item.checked) {
  1156 + checkedShopCoupon = item
  1157 + }
  1158 + })
  1159 + for (let j = 0; j < skuLen; j++) {
  1160 + const curSku = curShop.skus[j]
  1161 + const skuId = curSku.skuId
  1162 + // 不是定价捆绑,并且有配置可抵扣的积分,才有必要计算比例
  1163 + if (!curSku.priceId > 0 && skuCreditMap[skuId] > 0) {
  1164 + let remainSkuMoney = curSku.price * curSku.number
  1165 + if (checkedShopCoupon) {
  1166 + let skuShopPercent = remainSkuMoney / curShop.total
  1167 + let curReduceMoney = 0
  1168 + if (checkedShopCoupon.couponType === 1) {
  1169 + curReduceMoney = checkedShopCoupon.reduceMoney * skuShopPercent
  1170 + } else {
  1171 + curReduceMoney = remainSkuMoney * (10 - checkedShopCoupon.reduceMoney) / 10
  1172 + }
  1173 + remainSkuMoney = remainSkuMoney - curReduceMoney
  1174 + }
  1175 + // 使用平台券
  1176 + if (this.checkedPlatformCoupon && remainSkuMoney > 0) {
  1177 + // 满减
  1178 + if (this.checkedPlatformCoupon.couponType === 1) {
  1179 + let skuTotalPercent = remainSkuMoney / this.totalPrice
  1180 + remainSkuMoney -= this.checkedPlatformCoupon.reduceMoney * skuTotalPercent
  1181 + }
  1182 + // 折扣
  1183 + else {
  1184 + remainSkuMoney = remainSkuMoney * this.checkedPlatformCoupon.reduceMoney / 10
  1185 + }
  1186 + }
  1187 + skuRemainMap[skuId] = remainSkuMoney
  1188 + }
  1189 + }
  1190 + }
  1191 + return skuRemainMap
  1192 + },
  1193 + // 展示平台端优惠券
  1194 + showDiscount() {
  1195 + // let shopifAdd = 1
  1196 + // if(this.settlement.shops[this.shopIndex].shopCoupons.length>0){
  1197 + // shopifAdd = this.settlement.shops[this.shopIndex].shopCoupons[this.shopCouIndex].ifAdd
  1198 + // }
  1199 + if (this.settlement.coupons.length > 0) {
  1200 + for (let i = 0; i < this.selectShopCoupon.length; i++) {
  1201 + if (this.selectShopCoupon[i].ifAdd == 0) {
  1202 + uni.showToast({
  1203 + title: '不可叠加已选择的店铺券',
  1204 + icon: 'none'
  1205 + })
  1206 + return false
  1207 + }
  1208 + }
  1209 + this.isShowDiscount = true
  1210 + } else {
  1211 + uni.showToast({
  1212 + title: '暂无可用优惠券',
  1213 + icon: 'none'
  1214 + })
  1215 + }
  1216 + },
  1217 + // 显示店铺优惠券
  1218 + showShopCoupons(item, sIndex) {
  1219 + if (item.shopCoupons.length > 0) {
  1220 + this.isShopCoupons = true
  1221 + this.shopCouponslist = item
  1222 + this.shopCouponsLength = item.shopCoupons.length
  1223 + this.shopIndex = sIndex
  1224 + } else {
  1225 + uni.showToast({
  1226 + title: '暂无可用优惠券',
  1227 + icon: 'none'
  1228 + })
  1229 + }
  1230 + },
  1231 + onDiscountClose() {
  1232 + this.isShowDiscount = false
  1233 + },
  1234 + onshopClose() {
  1235 + this.isShopCoupons = false
  1236 + },
  1237 +
  1238 +
  1239 + /**
  1240 + * 检查提交表单
  1241 + * @return {boolean}
  1242 + */
  1243 + handleCheckOrderForm() {
  1244 + if (!this.payObj.paymentMode) {
  1245 + uni.showToast({
  1246 + title: '请选择支付方式',
  1247 + icon: 'none'
  1248 + })
  1249 + return false
  1250 + }
  1251 + if (!this.oneClickSubmit) {
  1252 + uni.showToast({
  1253 + title: "已提交,请勿重新操作!",
  1254 + icon: 'none'
  1255 + })
  1256 + return false
  1257 + }
  1258 + if (!this.userAddressInfo.receiveName) {
  1259 + uni.showToast({
  1260 + icon: 'none',
  1261 + title: '请选择收货地址'
  1262 + })
  1263 + return false
  1264 + }
  1265 + this.oneClickSubmit = false
  1266 + return true
  1267 + },
  1268 +
  1269 + /**
  1270 + * 支付更改事件
  1271 + * @param params
  1272 + */
  1273 + handleChangeCashier(params) {
  1274 + this.payObj = params
  1275 + console.log(params)
  1276 + },
  1277 +
  1278 + /**
  1279 + * 组装结算数据
  1280 + */
  1281 + handlePackageData() {
  1282 + uni.showLoading({
  1283 + mask: true,
  1284 + title: '订单提交中...',
  1285 + })
  1286 + let couponIdinfo = 0
  1287 + if (this.promotionInfoDTO.couponId) {
  1288 + couponIdinfo = this.promotionInfoDTO.couponId
  1289 + }
  1290 + let data = {
  1291 + shopDiscountId: null,
  1292 + collageId: this.collageId,
  1293 + type: this.sumitType,
  1294 + shopGroupWorkId: null,
  1295 + receiveId: this.receiveId,
  1296 + couponId: couponIdinfo,
  1297 + price: this.totalPrice,
  1298 + remark: "",
  1299 + shops: [],
  1300 + discountPrice: this.discountPrice,
  1301 + shopSeckillId: null
  1302 + }
  1303 +
  1304 + if (this.shopGroupWorkId > 0) {
  1305 + data.shopGroupWorkId = this.shopGroupWorkId
  1306 + }
  1307 +
  1308 + if (this.skuItemDTOList != '') {
  1309 + if (this.skuItemDTOList[0].shopDiscountId > 0) {
  1310 + data.shopDiscountId = this.skuItemDTOList[0].shopDiscountId
  1311 + } else if (this.skuItemDTOList[0].shopSeckillId > 0) {
  1312 + data.shopSeckillId = this.skuItemDTOList[0].shopSeckillId
  1313 + }
  1314 + }
  1315 + let datashopslen = this.settlement.shops.length
  1316 + for (let n = 0; n < datashopslen; n++) {
  1317 + let shopsobj = {}
  1318 + shopsobj["shopId"] = this.settlement.shops[n].shopId
  1319 + shopsobj["sceneId"] = this.settlement.shops[n].sceneId
  1320 + shopsobj["distribution"] = {}
  1321 + shopsobj["skus"] = []
  1322 + if (this.settlement.shops[n].currentCoupon) {
  1323 + shopsobj["id"] = this.settlement.shops[n].currentCoupon.id
  1324 + }
  1325 + data.shops.push(shopsobj)
  1326 + data.shops[n].distribution.distributionPrice = this.settlement.shops[n].distribution.distributionPrice
  1327 + data.shops[n].distribution.distributionName = this.settlement.shops[n].distribution.distributionName
  1328 + let dataskuslen = this.settlement.shops[n].skus.length
  1329 + for (let m = 0; m < dataskuslen; m++) {
  1330 + let skusobj = {}
  1331 + const curSku = this.settlement.shops[n].skus[m]
  1332 + skusobj["skuId"] = curSku.skuId
  1333 + skusobj["number"] = curSku.number
  1334 + skusobj["ifLogistics"] = curSku.ifLogistics
  1335 + skusobj["selected"] = curSku.selected
  1336 + skusobj["platformSeckillId"] = curSku.platformSeckillId
  1337 + skusobj["platformDiscountId"] = curSku.platformDiscountId
  1338 + skusobj["shopSeckillId"] = curSku.shopSeckillId
  1339 + skusobj["shopDiscountId"] = curSku.shopDiscountId
  1340 + skusobj["sceneId"] = curSku.sceneId
  1341 + skusobj["priceId"] = curSku.priceId
  1342 + skusobj["useMember"] = curSku.useMember
  1343 + skusobj["composeId"] = curSku.composeId
  1344 + // 处理埋点id
  1345 + this.pointProductIds += curSku.productId + ','
  1346 + // 积分传参
  1347 + if (this.selectIntegral && curSku.cachedCredit) {
  1348 + skusobj["useCredit"] = curSku.cachedCredit
  1349 + skusobj["useCreditAmount"] = (curSku.cachedCredit * this.integralRatio).toFixed(2)
  1350 + }
  1351 + data.shops[n].skus.push(skusobj)
  1352 + }
  1353 + }
  1354 +
  1355 + // 去除最后一个,
  1356 + if (this.pointProductIds.endsWith(',')) {
  1357 + this.pointProductIds = this.pointProductIds.slice(0, -1)
  1358 + }
  1359 + this.handleSetPayMode(data)
  1360 + uni.hideLoading()
  1361 + return data
  1362 + },
  1363 +
  1364 + /**
  1365 + * 根据环境设置下单的支付信息
  1366 + * @param data handlePackageData返回值
  1367 + */
  1368 + handleSetPayMode(data) {
  1369 + // subPaymentMode 1-小程序支付 2-app支付 3-H5支付
  1370 + // paymentMode 1-微信 2-支付宝
  1371 + data.paymentMode = this.payObj.paymentMode
  1372 + // #ifdef H5
  1373 + data.subPaymentMode = 3
  1374 + // #endif
  1375 +
  1376 + // #ifdef MP-WEIXIN
  1377 + data.subPaymentMode = 1
  1378 + // #endif
  1379 +
  1380 + // #ifdef APP-PLUS
  1381 + data.paymentMode = 1
  1382 + // #endif
  1383 + // #ifdef MP-ALIPAY
  1384 + data.subPaymentMode = 2
  1385 + // #endif
  1386 + },
  1387 + /**
  1388 + * 提交订单
  1389 + * @return {Promise<void>}
  1390 + */
  1391 + async submitOrder() {
  1392 + let that = this
  1393 + if (!this.handleCheckOrderForm()) return;
  1394 + // 处理表单
  1395 + const data = this.handlePackageData()
  1396 + console.error(this.couponId)
  1397 + if(this.couponId.id) {
  1398 + data.couponId = this.couponId.coupon.keyId
  1399 + data.discountPrice = data.discountPrice + this.ptyh
  1400 + data.price = data.price - this.ptyh
  1401 + }
  1402 + console.error(data)
  1403 + // return
  1404 + uni.showLoading({
  1405 + mask: true,
  1406 + title: '结算中...',
  1407 + })
  1408 + try {
  1409 + console.log('结算中结算中结算中结算中结算中结算中', data)
  1410 + const res = await NET.request(API.PlaceOrder, data, 'POST')
  1411 + // 下单成功处理埋点
  1412 + this.$store.dispatch('doPointer', {
  1413 + eventType: 3,
  1414 + productIds: this.pointProductIds
  1415 + })
  1416 + if (this.type == 2) {
  1417 + let carSkusData = data.shops
  1418 + let dataList = uni.getStorageSync('dataList')
  1419 + let ids = []
  1420 + for (const shopObj of dataList) {
  1421 + ids = [...ids, ...shopObj.skus.filter(sku => (sku.selected === 1 || sku.selected === true))
  1422 + .map(sku => sku.skuId)
  1423 + ]
  1424 + }
  1425 + await NET.request(API.DeleteCart, {
  1426 + ids
  1427 + }, 'POST')
  1428 + let skusArr = []
  1429 + for (let i = 0; i < carSkusData.length; i++) {
  1430 + carSkusData[i].skus.map(item => {
  1431 + skusArr.push(item.skuId)
  1432 + })
  1433 + }
  1434 + }
  1435 + let submitResult = res.data
  1436 + this.orderId = res.data.orderId
  1437 + submitResult.type = 1
  1438 + submitResult.paymentMode = data.paymentMode
  1439 + if (this.payObj.paymentMode && this.payObj.huabeiPeriod) {
  1440 + submitResult.huabeiPeriod = this.payObj.huabeiPeriod
  1441 + }
  1442 + await handleDoPay.call(this, submitResult)
  1443 +
  1444 + } catch (e) {
  1445 + this.oneClickSubmit = true
  1446 + uni.showToast({
  1447 + title: '订单结算错误',
  1448 + icon: 'none'
  1449 + })
  1450 + } finally {
  1451 + uni.hideLoading()
  1452 + }
  1453 + }
  1454 +
  1455 + }
  1456 + }
1342 1457 </script>
1343 1458  
1344 1459 <style lang="scss">
1345   -page {
1346   - background-color: #F7F7F7;
1347   -}
1348   -
1349   -.content {
1350   - padding: 0 30upx 198upx;
1351   - box-sizing: border-box;
1352   -}
1353   -
1354   -.address-box {
1355   - margin-top: 20upx;
1356   - background: #fff;
1357   - border-radius: 10upx;
1358   - width: 100%;
1359   - padding: 30upx;
1360   - box-sizing: border-box;
1361   - display: flex;
1362   - flex-direction: row;
1363   - align-items: center;
1364   - margin-bottom: 20rpx;
1365   -}
1366   -
1367   -.address-box .address-img {
1368   - width: 71upx;
1369   - height: 57upx;
1370   - margin-right: 20upx;
1371   -}
1372   -
1373   -.address-box .address-r {
1374   - flex: 1;
1375   - display: flex;
1376   - flex-direction: column;
1377   - font-size: 28upx;
1378   - color: #333;
1379   -}
1380   -
1381   -.arrow-right-img {
1382   - width: 62upx;
1383   - height: 62upx;
1384   - margin-left: 20upx;
1385   -}
1386   -
1387   -.address-name-box {
1388   - font-size: 30upx;
1389   - color: #333;
1390   -}
1391   -
1392   -.phone {
1393   - font-size: 24upx;
1394   - color: #999;
1395   - margin-left: 20upx;
1396   -}
1397   -
1398   -.address-info {
1399   - font-size: 28upx;
1400   - color: #333;
1401   - margin-top: 15upx;
1402   -}
1403   -
1404   -.order-list-box .item {
1405   - background: #fff;
1406   - border-radius: 10upx;
1407   -}
1408   -
1409   -.order-list-top {
1410   - height: 96upx;
1411   - padding: 0 30upx;
1412   - box-sizing: border-box;
1413   - display: flex;
1414   - flex-direction: row;
1415   - align-items: center;
1416   - justify-content: space-between;
1417   - border-bottom: 2rpx solid #eee;
1418   -}
1419   -
1420   -.top-l {
1421   - display: flex;
1422   - flex-direction: row;
1423   - align-items: center;
1424   -}
1425   -
1426   -.shop-img {
1427   - width: 34upx;
1428   - height: 34upx;
1429   - margin-right: 10upx;
1430   -}
1431   -
1432   -.shop-name {
1433   - font-size: 30upx;
1434   - color: #333;
1435   - font-weight: bold;
1436   -}
1437   -
1438   -.arrow-img {
1439   - margin-left: 15upx;
1440   - width: 62upx;
1441   - height: 62upx;
1442   -}
1443   -
1444   -.order-info-box {
1445   - padding: 0 30upx;
1446   - box-sizing: border-box;
1447   -}
1448   -
1449   -.order-info-item {
1450   - display: flex;
1451   - flex-direction: row;
1452   - padding: 20upx 0;
1453   -}
1454   -
1455   -.product-img {
1456   - width: 180upx;
1457   - height: 180upx;
1458   - border-radius: 10upx;
1459   - margin-right: 30upx;
1460   -}
1461   -
1462   -.info-box {
1463   - flex: 1;
1464   -}
1465   -
1466   -.product-name {
1467   - font-size: 26upx;
1468   - color: #333;
1469   - height: 68upx;
1470   - line-height: 34upx;
1471   - display: -webkit-box;
1472   - overflow: hidden;
1473   - text-overflow: ellipsis;
1474   - word-break: break-all;
1475   - -webkit-box-orient: vertical;
1476   - -webkit-line-clamp: 2;
1477   -}
1478   -
1479   -.price-sku-box {
1480   - width: 100%;
1481   - display: flex;
1482   - flex-direction: row;
1483   - justify-content: space-between;
1484   -}
1485   -
1486   -.product-sku {
1487   - font-size: 24upx;
1488   - font-weight: 500;
1489   - color: #999;
1490   - margin-left: -20upx;
1491   - width: 100%;
1492   - display: flex;
1493   - flex-direction: row;
1494   -}
1495   -
1496   -.product-price {
1497   - font-size: 32upx;
1498   - color: #C83732;
1499   - font-weight: 400;
1500   -}
1501   -
1502   -.product-price .fuhao {
1503   - font-size: 28upx;
1504   -}
1505   -
1506   -.product-num {
1507   - font-size: 28upx;
1508   - color: #999;
1509   - font-weight: 400;
1510   -}
1511   -
1512   -.adressTips {
1513   - margin-bottom: 19rpx;
1514   - color: #D53912;
1515   -}
1516   -
1517   -.delivery-way-box {
1518   - display: flex;
1519   - flex-direction: column;
1520   - border: 2rpx solid #E4E5E6;
1521   - padding: 20rpx;
1522   - margin-bottom: 20rpx;
1523   - box-sizing: content-box;
1524   -}
1525   -
1526   -.delivery-way-box .item {
1527   - display: flex;
1528   - flex-direction: row;
1529   - align-items: center;
1530   - justify-content: space-between;
1531   - font-size: 26upx;
1532   - color: #333;
1533   -}
1534   -
1535   -.delivery-way-box .item {
1536   - display: flex;
1537   - flex-direction: row;
1538   - align-items: center;
1539   - justify-content: space-between;
1540   - font-size: 26rpx;
1541   - color: #333;
1542   -}
1543   -
1544   -.delivery-way-box .item .way {
1545   - color: #999;
1546   - margin-left: 30upx;
1547   -}
1548   -
1549   -.order-total-box {
1550   - padding: 20upx 0;
1551   - text-align: right;
1552   -}
1553   -
1554   -.total-num {
1555   - font-size: 26upx;
1556   - color: #333;
1557   -}
1558   -
1559   -.total-price {
1560   - font-size: 46rpx;
1561   - color: #333333;
1562   -}
1563   -
1564   -.ml10 {
1565   - margin-left: 10upx;
1566   -}
1567   -
1568   -.order-flow-box {
1569   - display: flex;
1570   - flex-direction: column;
1571   -}
1572   -
1573   -.flow-word {
1574   - font-size: 24upx;
1575   - color: #999;
1576   - display: flex;
1577   - flex-direction: column;
1578   -}
1579   -
1580   -.mt25 {
1581   - margin-top: 20upx;
1582   -}
1583   -
1584   -.mt50 {
1585   - margin-top: 30upx;
1586   - margin-bottom: 20upx;
1587   -}
1588   -
1589   -.order-confirm-box {
1590   - position: fixed;
1591   - bottom: 0;
1592   - left: 0;
1593   - width: 100%;
1594   - background: #fff;
1595   - padding: 30upx;
1596   -}
1597   -
1598   -.num-box {
1599   - font-size: 30upx;
1600   - color: #999;
1601   -}
1602   -
1603   -.num-box .total {
1604   - color: #333;
1605   -}
1606   -
1607   -.num-box .price {
1608   - color: #ff7911;
1609   - font-weight: bold;
1610   -}
1611   -
1612   -.order-confirm-box .btn {
1613   - width: 100%;
1614   - height: 80rpx;
1615   - line-height: 80rpx;
1616   - background: #eee;
1617   - font-size: 28rpx;
1618   - color: #FFEBC4;
1619   - text-align: center;
1620   - margin-top: 20rpx;
1621   -}
1622   -
1623   -.order-confirm-box .btn.active {
1624   - background: #333333;
1625   - color: #FFEBC4;
1626   -}
1627   -
1628   -.order-confirm-box .btn.unActive {
1629   - background: #333333;
1630   - color: #FFEBC4;
1631   - opacity: 0.7;
1632   -}
1633   -
1634   -.discount-item1 {
1635   - width: 100%;
1636   - box-sizing: border-box;
1637   - display: flex;
1638   - flex-direction: row;
1639   - align-items: center;
1640   - justify-content: space-between;
1641   - background: white;
1642   - padding: 20rpx;
1643   - border: 2rpx solid #E4E5E6;
1644   -}
1645   -
1646   -.discount-item {
1647   - width: 100%;
1648   - height: 98upx;
1649   - box-sizing: border-box;
1650   - margin: 30upx 0;
1651   - display: flex;
1652   - flex-direction: row;
1653   - align-items: center;
1654   - justify-content: space-between;
1655   - padding: 0 20upx;
1656   - background: white;
1657   -}
1658   -
1659   -.pay-type-item {
1660   - .pay-type-radio {
1661   - background-color: white;
1662   - border-bottom: 1upx solid #EDEDED;
1663   - margin-bottom: 20upx;
1664   - padding: 24upx 20upx 24upx 20upx;
1665   -
1666   - .pay-type-img {
1667   - display: inline-block;
1668   -
1669   - .pay-type-img-inner {
1670   - width: 50upx;
1671   - height: 50upx;
1672   - vertical-align: middle;
1673   - }
1674   - }
1675   -
1676   - .pay-type-label {
1677   - vertical-align: middle;
1678   - margin-left: 30upx;
1679   - }
1680   -
1681   - .pay-type-radio-item {
1682   - float: right;
1683   - width: 50upx;
1684   - height: 50upx;
1685   - }
1686   -
1687   - .huabei-detail {
1688   - margin-top: 20upx;
1689   -
1690   - .fenqi-wenzi {
1691   - display: inline-block;
1692   - margin-left: 64upx;
1693   - }
1694   -
1695   - .fenqi-amount {
1696   - display: block;
1697   - margin-left: 64upx;
1698   - margin-top: 14upx;
1699   - color: #BABBBC;
1700   - }
1701   -
1702   - .fenqi-charge-fee {
1703   - float: right;
1704   - margin-right: 68upx;
1705   - color: #BABBBC;
1706   - }
1707   -
1708   - .fenqi-modal {
1709   - width: 40upx;
1710   - height: 40upx;
1711   - margin-left: 20upx;
1712   - float: right;
1713   - position: relative;
1714   - top: -80upx;
1715   - }
1716   - }
1717   - }
1718   -}
1719   -
1720   -.period-radio {
1721   - margin: 30upx;
1722   - width: 95%;
1723   - border-bottom: 1px solid #EFEFEF;
1724   -
1725   - .period-amount {
1726   - display: inline-block;
1727   -
1728   - .period-each-charge {
1729   - display: inline-block;
1730   - margin-top: 12upx;
1731   - margin-left: 6upx;
1732   - font-size: 26upx;
1733   - color: #b7b7b7;
1734   - margin-bottom: 13upx;
1735   - }
1736   - }
1737   -
1738   - .period-each {
1739   - display: block;
1740   - }
1741   -
1742   - .period-type-radio-item {
1743   - float: right;
1744   - }
1745   -}
1746   -
1747   -.huabei-confirm {
1748   - height: 120upx;
1749   - padding: 0upx 108upx 0upx 32upx;
1750   -
1751   - .fenqi-all {
1752   - display: inline-block;
1753   - width: 100%;
1754   - }
1755   -
1756   - .fenqi-total-amount {
1757   - float: left;
1758   - }
1759   -
1760   - .fenqi-confirm {
1761   - float: right;
1762   - width: 160upx;
1763   - padding: 0upx 20upx;
1764   -
1765   - .btn {
1766   - width: 216upx;
1767   - height: 80upx;
1768   - line-height: 80upx;
1769   - border-radius: 40upx;
1770   - font-size: 28upx;
1771   - text-align: center;
1772   - background: linear-gradient(90deg, rgba(255, 162, 0, 1), rgba(255, 121, 17, 1));
1773   - color: #fff;
1774   - display: inline-block;
1775   - margin-right: 66upx;
1776   - }
1777   - }
1778   -}
1779   -
1780   -.discount-info-box {
1781   - display: flex;
1782   - flex-direction: row;
1783   -}
1784   -
1785   -.discount-label,
1786   -.discount-info1 {
1787   - font-size: 26upx;
1788   - color: #333;
1789   -}
1790   -
1791   -.discount-info2 {
1792   - color: #C5AA7B;
1793   -}
1794   -
1795   -.discount-img {
1796   - width: 30upx;
1797   - height: 30upx;
1798   - margin-left: 20upx;
1799   -}
1800   -
1801   -.activity-con {
1802   - .activity-box {
1803   - display: flex;
1804   - flex-direction: column;
1805   - width: 100%;
1806   - height: 1000upx;
1807   - }
1808   -
1809   -}
1810   -
1811   -.activity-box .title-box {
1812   - width: 100%;
1813   - height: 100upx;
1814   - display: flex;
1815   - flex-direction: row;
1816   - align-items: center;
1817   - justify-content: center;
1818   - position: relative;
1819   - border-bottom: solid 1px #EEEEEE;
1820   -}
1821   -
1822   -.activity-coupon-box {
1823   - display: flex;
1824   - flex-direction: column;
1825   - width: 100%;
1826   - overflow: auto;
1827   - flex: 1;
1828   -}
1829   -
1830   -.title-box .close-btn {
1831   - width: 100upx;
1832   - height: 100upx;
1833   - box-sizing: border-box;
1834   - padding: 30upx;
1835   - position: absolute;
1836   - top: 0;
1837   - right: 0;
1838   -}
1839   -
1840   -.content-box {
1841   - width: 100%;
1842   - box-sizing: border-box;
1843   - display: flex;
1844   - flex-direction: column;
1845   - padding: 30upx;
1846   -}
1847   -
1848   -.tag-box {
1849   - width: 100%;
1850   - box-sizing: border-box;
1851   - height: 80upx;
1852   - line-height: 80upx;
1853   - font-size: 28upx;
1854   - font-weight: 500;
1855   - color: #FF7911;
1856   -}
1857   -
1858   -.label-lingqu {
1859   - width: 100%;
1860   - font-size: 28upx;
1861   - font-weight: 500;
1862   - color: rgba(51, 51, 51, 1);
1863   -}
1864   -
1865   -.coupon-item1 {
1866   - width: 690upx;
1867   - height: 120upx;
1868   - margin-top: 20upx;
1869   - color: #FFFFFF;
1870   - flex-shrink: 0;
1871   -}
1872   -
1873   -.coupon-item2 {
1874   - width: 690upx;
1875   - height: 120upx;
1876   - background-size: 690upx 120upx;
1877   - margin-top: 20upx;
1878   - color: rgba(255, 121, 17, 1);
1879   - flex-shrink: 0
1880   -}
1881   -
1882   -.un-coupon-item {
1883   - color: #bbb;
1884   -}
1885   -
1886   -.money-box {
1887   - font-size: 40upx;
1888   - font-weight: 500;
1889   -
1890   -}
1891   -
1892   -.info-box {
1893   - font-size: 24upx;
1894   - font-weight: 400;
1895   - margin: 10rpx;
1896   -}
1897   -
1898   -
1899   -.receive-success {
1900   - width: 100%;
1901   - position: fixed;
1902   - top: 0;
1903   - bottom: 0;
1904   - left: 0;
1905   - display: flex;
1906   - flex-direction: column;
1907   - align-items: center;
1908   - justify-content: center;
1909   - z-index: 9999;
1910   -}
1911   -
1912   -.success-box {
1913   - width: 380upx;
1914   - height: 280upx;
1915   - background: rgba(0, 0, 0, 0.5);
1916   - border-radius: 10upx;
1917   - display: flex;
1918   - flex-direction: column;
1919   - align-items: center;
1920   - justify-content: center;
1921   -}
1922   -
1923   -.success-box .success-img {
1924   - width: 200upx;
1925   - height: 130upx;
1926   -}
1927   -
1928   -.success-box .text {
1929   - font-size: 28upx;
1930   - margin-top: 50upx;
1931   - font-weight: 400;
1932   - color: rgba(255, 255, 255, 1);
1933   -}
1934   -
1935   -.check-img {
1936   - width: 40upx;
1937   - height: 40upx;
1938   - margin-top: 40rpx;
1939   -}
1940   -
1941   -.mt30 {
1942   - margin-top: 30upx;
1943   -}
1944   -
1945   -.activity-con {
1946   - .activity-box {
1947   - display: flex;
1948   - flex-direction: column;
1949   - width: 100%;
1950   - height: 1000upx;
1951   - }
1952   -
1953   -}
1954   -
1955   -.activity-box .title-box {
1956   - width: 100%;
1957   - height: 100upx;
1958   - display: flex;
1959   - flex-direction: row;
1960   - align-items: center;
1961   - justify-content: center;
1962   - position: relative;
1963   - border-bottom: solid 1px #EEEEEE;
1964   -}
1965   -
1966   -.activity-coupon-box {
1967   - display: flex;
1968   - flex-direction: column;
1969   - width: 100%;
1970   - overflow: auto;
1971   - flex: 1;
1972   -}
1973   -
1974   -.title-box .close-btn {
1975   - width: 100upx;
1976   - height: 100upx;
1977   - box-sizing: border-box;
1978   - padding: 30upx;
1979   - position: absolute;
1980   - top: 0;
1981   - right: 0;
1982   -}
1983   -
1984   -.content-box {
1985   - width: 100%;
1986   - box-sizing: border-box;
1987   - display: flex;
1988   - flex-direction: column;
1989   - padding: 30upx;
1990   -}
1991   -
1992   -.tag-box {
1993   - width: 100%;
1994   - box-sizing: border-box;
1995   - height: 80upx;
1996   - line-height: 80upx;
1997   - font-size: 28upx;
1998   - font-weight: 500;
1999   - color: #FF7911;
2000   -}
2001   -
2002   -.label-lingqu {
2003   - width: 100%;
2004   - font-size: 28upx;
2005   - font-weight: 500;
2006   - color: rgba(51, 51, 51, 1);
2007   -}
2008   -
2009   -.couponBox {
2010   - display: flex;
2011   - flex-flow: wrap;
2012   - margin-top: 30rpx;
2013   - justify-content: space-between;
2014   -}
2015   -
2016   -.coupon-item {
2017   - width: 48%;
2018   - height: 291rpx;
2019   - background: url("https://jy.scjysm.asia:18086/mefile/file/static/images/couponsIcon.png") no-repeat center top;
2020   - margin-top: 20upx;
2021   - color: #C5AA7B;
2022   - flex-shrink: 0;
2023   - text-align: center;
2024   - padding-top: 1rpx;
2025   - background-size: contain;
2026   -}
2027   -
2028   -.un-coupon-item {
2029   - color: #bbb;
2030   -}
2031   -
2032   -.money-box {
2033   - font-size: 40upx;
2034   - font-weight: 500;
2035   - margin-top: 30rpx;
2036   -}
2037   -
2038   -.integralPayBox {
2039   - margin: 20rpx 0;
2040   -
2041   - .integralBg {
2042   - height: 98rpx;
2043   - display: flex;
2044   - justify-content: space-between;
2045   - align-items: center;
2046   - background: #FFFFFF;
2047   - padding: 0 20rpx;
2048   -
2049   - .maxDeduction {
2050   - margin-right: 15rpx;
2051   - }
2052   - }
2053   -}
  1460 + page {
  1461 + background-color: #F7F7F7;
  1462 + }
  1463 +
  1464 + .content {
  1465 + padding: 0 30upx 198upx;
  1466 + box-sizing: border-box;
  1467 + }
  1468 +
  1469 + .address-box {
  1470 + margin-top: 20upx;
  1471 + background: #fff;
  1472 + border-radius: 10upx;
  1473 + width: 100%;
  1474 + padding: 30upx;
  1475 + box-sizing: border-box;
  1476 + display: flex;
  1477 + flex-direction: row;
  1478 + align-items: center;
  1479 + margin-bottom: 20rpx;
  1480 + }
  1481 +
  1482 + .address-box .address-img {
  1483 + width: 71upx;
  1484 + height: 57upx;
  1485 + margin-right: 20upx;
  1486 + }
  1487 +
  1488 + .address-box .address-r {
  1489 + flex: 1;
  1490 + display: flex;
  1491 + flex-direction: column;
  1492 + font-size: 28upx;
  1493 + color: #333;
  1494 + }
  1495 +
  1496 + .arrow-right-img {
  1497 + width: 62upx;
  1498 + height: 62upx;
  1499 + margin-left: 20upx;
  1500 + }
  1501 +
  1502 + .address-name-box {
  1503 + font-size: 30upx;
  1504 + color: #333;
  1505 + }
  1506 +
  1507 + .phone {
  1508 + font-size: 24upx;
  1509 + color: #999;
  1510 + margin-left: 20upx;
  1511 + }
  1512 +
  1513 + .address-info {
  1514 + font-size: 28upx;
  1515 + color: #333;
  1516 + margin-top: 15upx;
  1517 + }
  1518 +
  1519 + .order-list-box .item {
  1520 + background: #fff;
  1521 + border-radius: 10upx;
  1522 + }
  1523 +
  1524 + .order-list-top {
  1525 + height: 96upx;
  1526 + padding: 0 30upx;
  1527 + box-sizing: border-box;
  1528 + display: flex;
  1529 + flex-direction: row;
  1530 + align-items: center;
  1531 + justify-content: space-between;
  1532 + border-bottom: 2rpx solid #eee;
  1533 + }
  1534 +
  1535 + .top-l {
  1536 + display: flex;
  1537 + flex-direction: row;
  1538 + align-items: center;
  1539 + }
  1540 +
  1541 + .shop-img {
  1542 + width: 34upx;
  1543 + height: 34upx;
  1544 + margin-right: 10upx;
  1545 + }
  1546 +
  1547 + .shop-name {
  1548 + font-size: 30upx;
  1549 + color: #333;
  1550 + font-weight: bold;
  1551 + }
  1552 +
  1553 + .arrow-img {
  1554 + margin-left: 15upx;
  1555 + width: 62upx;
  1556 + height: 62upx;
  1557 + }
  1558 +
  1559 + .order-info-box {
  1560 + padding: 0 30upx;
  1561 + box-sizing: border-box;
  1562 + }
  1563 +
  1564 + .order-info-item {
  1565 + display: flex;
  1566 + flex-direction: row;
  1567 + padding: 20upx 0;
  1568 + }
  1569 +
  1570 + .product-img {
  1571 + width: 180upx;
  1572 + height: 180upx;
  1573 + border-radius: 10upx;
  1574 + margin-right: 30upx;
  1575 + }
  1576 +
  1577 + .info-box {
  1578 + flex: 1;
  1579 + }
  1580 +
  1581 + .product-name {
  1582 + font-size: 26upx;
  1583 + color: #333;
  1584 + height: 68upx;
  1585 + line-height: 34upx;
  1586 + display: -webkit-box;
  1587 + overflow: hidden;
  1588 + text-overflow: ellipsis;
  1589 + word-break: break-all;
  1590 + -webkit-box-orient: vertical;
  1591 + -webkit-line-clamp: 2;
  1592 + }
  1593 +
  1594 + .price-sku-box {
  1595 + width: 100%;
  1596 + display: flex;
  1597 + flex-direction: row;
  1598 + justify-content: space-between;
  1599 + }
  1600 +
  1601 + .product-sku {
  1602 + font-size: 24upx;
  1603 + font-weight: 500;
  1604 + color: #999;
  1605 + margin-left: -20upx;
  1606 + width: 100%;
  1607 + display: flex;
  1608 + flex-direction: row;
  1609 + }
  1610 +
  1611 + .product-price {
  1612 + font-size: 32upx;
  1613 + color: #C83732;
  1614 + font-weight: 400;
  1615 + }
  1616 +
  1617 + .product-price .fuhao {
  1618 + font-size: 28upx;
  1619 + }
  1620 +
  1621 + .product-num {
  1622 + font-size: 28upx;
  1623 + color: #999;
  1624 + font-weight: 400;
  1625 + }
  1626 +
  1627 + .adressTips {
  1628 + margin-bottom: 19rpx;
  1629 + color: #D53912;
  1630 + }
  1631 +
  1632 + .delivery-way-box {
  1633 + display: flex;
  1634 + flex-direction: column;
  1635 + border: 2rpx solid #E4E5E6;
  1636 + padding: 20rpx;
  1637 + margin-bottom: 20rpx;
  1638 + box-sizing: content-box;
  1639 + }
  1640 +
  1641 + .delivery-way-box .item {
  1642 + display: flex;
  1643 + flex-direction: row;
  1644 + align-items: center;
  1645 + justify-content: space-between;
  1646 + font-size: 26upx;
  1647 + color: #333;
  1648 + }
  1649 +
  1650 + .delivery-way-box .item {
  1651 + display: flex;
  1652 + flex-direction: row;
  1653 + align-items: center;
  1654 + justify-content: space-between;
  1655 + font-size: 26rpx;
  1656 + color: #333;
  1657 + }
  1658 +
  1659 + .delivery-way-box .item .way {
  1660 + color: #999;
  1661 + margin-left: 30upx;
  1662 + }
  1663 +
  1664 + .order-total-box {
  1665 + padding: 20upx 0;
  1666 + text-align: right;
  1667 + }
  1668 +
  1669 + .total-num {
  1670 + font-size: 26upx;
  1671 + color: #333;
  1672 + }
  1673 +
  1674 + .total-price {
  1675 + font-size: 46rpx;
  1676 + color: #333333;
  1677 + }
  1678 +
  1679 + .ml10 {
  1680 + margin-left: 10upx;
  1681 + }
  1682 +
  1683 + .order-flow-box {
  1684 + display: flex;
  1685 + flex-direction: column;
  1686 + }
  1687 +
  1688 + .flow-word {
  1689 + font-size: 24upx;
  1690 + color: #999;
  1691 + display: flex;
  1692 + flex-direction: column;
  1693 + }
  1694 +
  1695 + .mt25 {
  1696 + margin-top: 20upx;
  1697 + }
  1698 +
  1699 + .mt50 {
  1700 + margin-top: 30upx;
  1701 + margin-bottom: 20upx;
  1702 + }
  1703 +
  1704 + .order-confirm-box {
  1705 + position: fixed;
  1706 + bottom: 0;
  1707 + left: 0;
  1708 + width: 100%;
  1709 + background: #fff;
  1710 + padding: 30upx;
  1711 + }
  1712 +
  1713 + .num-box {
  1714 + font-size: 30upx;
  1715 + color: #999;
  1716 + }
  1717 +
  1718 + .num-box .total {
  1719 + color: #333;
  1720 + }
  1721 +
  1722 + .num-box .price {
  1723 + color: #ff7911;
  1724 + font-weight: bold;
  1725 + }
  1726 +
  1727 + .order-confirm-box .btn {
  1728 + width: 100%;
  1729 + height: 80rpx;
  1730 + line-height: 80rpx;
  1731 + background: #eee;
  1732 + font-size: 28rpx;
  1733 + color: #FFEBC4;
  1734 + text-align: center;
  1735 + margin-top: 20rpx;
  1736 + }
  1737 +
  1738 + .order-confirm-box .btn.active {
  1739 + background: #333333;
  1740 + color: #FFEBC4;
  1741 + }
  1742 +
  1743 + .order-confirm-box .btn.unActive {
  1744 + background: #333333;
  1745 + color: #FFEBC4;
  1746 + opacity: 0.7;
  1747 + }
  1748 +
  1749 + .discount-item1 {
  1750 + width: 100%;
  1751 + box-sizing: border-box;
  1752 + display: flex;
  1753 + flex-direction: row;
  1754 + align-items: center;
  1755 + justify-content: space-between;
  1756 + background: white;
  1757 + padding: 20rpx;
  1758 + border: 2rpx solid #E4E5E6;
  1759 + }
  1760 +
  1761 + .discount-item {
  1762 + width: 100%;
  1763 + height: 98upx;
  1764 + box-sizing: border-box;
  1765 + margin: 30upx 0;
  1766 + display: flex;
  1767 + flex-direction: row;
  1768 + align-items: center;
  1769 + justify-content: space-between;
  1770 + padding: 0 20upx;
  1771 + background: white;
  1772 + }
  1773 +
  1774 + .pay-type-item {
  1775 + .pay-type-radio {
  1776 + background-color: white;
  1777 + border-bottom: 1upx solid #EDEDED;
  1778 + margin-bottom: 20upx;
  1779 + padding: 24upx 20upx 24upx 20upx;
  1780 +
  1781 + .pay-type-img {
  1782 + display: inline-block;
  1783 +
  1784 + .pay-type-img-inner {
  1785 + width: 50upx;
  1786 + height: 50upx;
  1787 + vertical-align: middle;
  1788 + }
  1789 + }
  1790 +
  1791 + .pay-type-label {
  1792 + vertical-align: middle;
  1793 + margin-left: 30upx;
  1794 + }
  1795 +
  1796 + .pay-type-radio-item {
  1797 + float: right;
  1798 + width: 50upx;
  1799 + height: 50upx;
  1800 + }
  1801 +
  1802 + .huabei-detail {
  1803 + margin-top: 20upx;
  1804 +
  1805 + .fenqi-wenzi {
  1806 + display: inline-block;
  1807 + margin-left: 64upx;
  1808 + }
  1809 +
  1810 + .fenqi-amount {
  1811 + display: block;
  1812 + margin-left: 64upx;
  1813 + margin-top: 14upx;
  1814 + color: #BABBBC;
  1815 + }
  1816 +
  1817 + .fenqi-charge-fee {
  1818 + float: right;
  1819 + margin-right: 68upx;
  1820 + color: #BABBBC;
  1821 + }
  1822 +
  1823 + .fenqi-modal {
  1824 + width: 40upx;
  1825 + height: 40upx;
  1826 + margin-left: 20upx;
  1827 + float: right;
  1828 + position: relative;
  1829 + top: -80upx;
  1830 + }
  1831 + }
  1832 + }
  1833 + }
  1834 +
  1835 + .period-radio {
  1836 + margin: 30upx;
  1837 + width: 95%;
  1838 + border-bottom: 1px solid #EFEFEF;
  1839 +
  1840 + .period-amount {
  1841 + display: inline-block;
  1842 +
  1843 + .period-each-charge {
  1844 + display: inline-block;
  1845 + margin-top: 12upx;
  1846 + margin-left: 6upx;
  1847 + font-size: 26upx;
  1848 + color: #b7b7b7;
  1849 + margin-bottom: 13upx;
  1850 + }
  1851 + }
  1852 +
  1853 + .period-each {
  1854 + display: block;
  1855 + }
  1856 +
  1857 + .period-type-radio-item {
  1858 + float: right;
  1859 + }
  1860 + }
  1861 +
  1862 + .huabei-confirm {
  1863 + height: 120upx;
  1864 + padding: 0upx 108upx 0upx 32upx;
  1865 +
  1866 + .fenqi-all {
  1867 + display: inline-block;
  1868 + width: 100%;
  1869 + }
  1870 +
  1871 + .fenqi-total-amount {
  1872 + float: left;
  1873 + }
  1874 +
  1875 + .fenqi-confirm {
  1876 + float: right;
  1877 + width: 160upx;
  1878 + padding: 0upx 20upx;
  1879 +
  1880 + .btn {
  1881 + width: 216upx;
  1882 + height: 80upx;
  1883 + line-height: 80upx;
  1884 + border-radius: 40upx;
  1885 + font-size: 28upx;
  1886 + text-align: center;
  1887 + background: linear-gradient(90deg, rgba(255, 162, 0, 1), rgba(255, 121, 17, 1));
  1888 + color: #fff;
  1889 + display: inline-block;
  1890 + margin-right: 66upx;
  1891 + }
  1892 + }
  1893 + }
  1894 +
  1895 + .discount-info-box {
  1896 + display: flex;
  1897 + flex-direction: row;
  1898 + }
  1899 +
  1900 + .discount-label,
  1901 + .discount-info1 {
  1902 + font-size: 26upx;
  1903 + color: #333;
  1904 + }
  1905 +
  1906 + .discount-info2 {
  1907 + color: #C5AA7B;
  1908 + }
  1909 +
  1910 + .discount-img {
  1911 + width: 30upx;
  1912 + height: 30upx;
  1913 + margin-left: 20upx;
  1914 + }
  1915 +
  1916 + .activity-con {
  1917 + .activity-box {
  1918 + display: flex;
  1919 + flex-direction: column;
  1920 + width: 100%;
  1921 + height: 1000upx;
  1922 + }
  1923 +
  1924 + }
  1925 +
  1926 + .activity-box .title-box {
  1927 + width: 100%;
  1928 + height: 100upx;
  1929 + display: flex;
  1930 + flex-direction: row;
  1931 + align-items: center;
  1932 + justify-content: center;
  1933 + position: relative;
  1934 + border-bottom: solid 1px #EEEEEE;
  1935 + }
  1936 +
  1937 + .activity-coupon-box {
  1938 + display: flex;
  1939 + flex-direction: column;
  1940 + width: 100%;
  1941 + overflow: auto;
  1942 + flex: 1;
  1943 + }
  1944 +
  1945 + .title-box .close-btn {
  1946 + width: 100upx;
  1947 + height: 100upx;
  1948 + box-sizing: border-box;
  1949 + padding: 30upx;
  1950 + position: absolute;
  1951 + top: 0;
  1952 + right: 0;
  1953 + }
  1954 +
  1955 + .content-box {
  1956 + width: 100%;
  1957 + box-sizing: border-box;
  1958 + display: flex;
  1959 + flex-direction: column;
  1960 + padding: 30upx;
  1961 + }
  1962 +
  1963 + .tag-box {
  1964 + width: 100%;
  1965 + box-sizing: border-box;
  1966 + height: 80upx;
  1967 + line-height: 80upx;
  1968 + font-size: 28upx;
  1969 + font-weight: 500;
  1970 + color: #FF7911;
  1971 + }
  1972 +
  1973 + .label-lingqu {
  1974 + width: 100%;
  1975 + font-size: 28upx;
  1976 + font-weight: 500;
  1977 + color: rgba(51, 51, 51, 1);
  1978 + }
  1979 +
  1980 + .coupon-item1 {
  1981 + width: 690upx;
  1982 + height: 120upx;
  1983 + margin-top: 20upx;
  1984 + color: #FFFFFF;
  1985 + flex-shrink: 0;
  1986 + }
  1987 +
  1988 + .coupon-item2 {
  1989 + width: 690upx;
  1990 + height: 120upx;
  1991 + background-size: 690upx 120upx;
  1992 + margin-top: 20upx;
  1993 + color: rgba(255, 121, 17, 1);
  1994 + flex-shrink: 0
  1995 + }
  1996 +
  1997 + .un-coupon-item {
  1998 + color: #bbb;
  1999 + }
  2000 +
  2001 + .money-box {
  2002 + font-size: 40upx;
  2003 + font-weight: 500;
  2004 +
  2005 + }
  2006 +
  2007 + .info-box {
  2008 + font-size: 24upx;
  2009 + font-weight: 400;
  2010 + margin: 10rpx;
  2011 + }
  2012 +
  2013 +
  2014 + .receive-success {
  2015 + width: 100%;
  2016 + position: fixed;
  2017 + top: 0;
  2018 + bottom: 0;
  2019 + left: 0;
  2020 + display: flex;
  2021 + flex-direction: column;
  2022 + align-items: center;
  2023 + justify-content: center;
  2024 + z-index: 9999;
  2025 + }
  2026 +
  2027 + .success-box {
  2028 + width: 380upx;
  2029 + height: 280upx;
  2030 + background: rgba(0, 0, 0, 0.5);
  2031 + border-radius: 10upx;
  2032 + display: flex;
  2033 + flex-direction: column;
  2034 + align-items: center;
  2035 + justify-content: center;
  2036 + }
  2037 +
  2038 + .success-box .success-img {
  2039 + width: 200upx;
  2040 + height: 130upx;
  2041 + }
  2042 +
  2043 + .success-box .text {
  2044 + font-size: 28upx;
  2045 + margin-top: 50upx;
  2046 + font-weight: 400;
  2047 + color: rgba(255, 255, 255, 1);
  2048 + }
  2049 +
  2050 + .check-img {
  2051 + width: 40upx;
  2052 + height: 40upx;
  2053 + margin-top: 40rpx;
  2054 + }
  2055 +
  2056 + .mt30 {
  2057 + margin-top: 30upx;
  2058 + }
  2059 +
  2060 + .activity-con {
  2061 + .activity-box {
  2062 + display: flex;
  2063 + flex-direction: column;
  2064 + width: 100%;
  2065 + height: 1000upx;
  2066 + }
  2067 +
  2068 + }
  2069 +
  2070 + .activity-box .title-box {
  2071 + width: 100%;
  2072 + height: 100upx;
  2073 + display: flex;
  2074 + flex-direction: row;
  2075 + align-items: center;
  2076 + justify-content: center;
  2077 + position: relative;
  2078 + border-bottom: solid 1px #EEEEEE;
  2079 + }
  2080 +
  2081 + .activity-coupon-box {
  2082 + display: flex;
  2083 + flex-direction: column;
  2084 + width: 100%;
  2085 + overflow: auto;
  2086 + flex: 1;
  2087 + }
  2088 +
  2089 + .title-box .close-btn {
  2090 + width: 100upx;
  2091 + height: 100upx;
  2092 + box-sizing: border-box;
  2093 + padding: 30upx;
  2094 + position: absolute;
  2095 + top: 0;
  2096 + right: 0;
  2097 + }
  2098 +
  2099 + .content-box {
  2100 + width: 100%;
  2101 + box-sizing: border-box;
  2102 + display: flex;
  2103 + flex-direction: column;
  2104 + padding: 30upx;
  2105 + }
  2106 +
  2107 + .tag-box {
  2108 + width: 100%;
  2109 + box-sizing: border-box;
  2110 + height: 80upx;
  2111 + line-height: 80upx;
  2112 + font-size: 28upx;
  2113 + font-weight: 500;
  2114 + color: #FF7911;
  2115 + }
  2116 +
  2117 + .label-lingqu {
  2118 + width: 100%;
  2119 + font-size: 28upx;
  2120 + font-weight: 500;
  2121 + color: rgba(51, 51, 51, 1);
  2122 + }
  2123 +
  2124 + .couponBox {
  2125 + display: flex;
  2126 + flex-flow: wrap;
  2127 + margin-top: 30rpx;
  2128 + justify-content: space-between;
  2129 + }
  2130 +
  2131 + .coupon-item {
  2132 + width: 48%;
  2133 + height: 291rpx;
  2134 + background: url("https://jy.scjysm.asia:18086/mefile/file/static/images/couponsIcon.png") no-repeat center top;
  2135 + margin-top: 20upx;
  2136 + color: #C5AA7B;
  2137 + flex-shrink: 0;
  2138 + text-align: center;
  2139 + padding-top: 1rpx;
  2140 + background-size: contain;
  2141 + }
  2142 +
  2143 + .un-coupon-item {
  2144 + color: #bbb;
  2145 + }
  2146 +
  2147 + .money-box {
  2148 + font-size: 40upx;
  2149 + font-weight: 500;
  2150 + margin-top: 30rpx;
  2151 + }
  2152 +
  2153 + .integralPayBox {
  2154 + margin: 20rpx 0;
  2155 +
  2156 + .integralBg {
  2157 + height: 98rpx;
  2158 + display: flex;
  2159 + justify-content: space-between;
  2160 + align-items: center;
  2161 + background: #FFFFFF;
  2162 + padding: 0 20rpx;
  2163 +
  2164 + .maxDeduction {
  2165 + margin-right: 15rpx;
  2166 + }
  2167 + }
  2168 + }
2054 2169 </style>
2055 2170 <style>
2056   -.pay-type-item /deep/ .uni-radio-input-checked {
2057   - background-color: #C5AA7B !important;
2058   - border-color: #C5AA7B !important;
2059   -}
2060   -
2061   -.maxIntegral /deep/ .uni-checkbox-input {
2062   - width: 30rpx;
2063   - height: 30rpx;
2064   -}
2065   -
2066   -.maxIntegral /deep/ .uni-checkbox-input-checked:before {
2067   - font-size: 30rpx;
2068   -}
2069   -
2070   -.maxIntegral /deep/ .uni-checkbox-input-checked {
2071   - border: 2rpx solid #C5AA7B !important;
2072   -}
2073   -</style>
  2171 + .pay-type-item /deep/ .uni-radio-input-checked {
  2172 + background-color: #C5AA7B !important;
  2173 + border-color: #C5AA7B !important;
  2174 + }
  2175 +
  2176 + .maxIntegral /deep/ .uni-checkbox-input {
  2177 + width: 30rpx;
  2178 + height: 30rpx;
  2179 + }
  2180 +
  2181 + .maxIntegral /deep/ .uni-checkbox-input-checked:before {
  2182 + font-size: 30rpx;
  2183 + }
  2184 +
  2185 + .maxIntegral /deep/ .uni-checkbox-input-checked {
  2186 + border: 2rpx solid #C5AA7B !important;
  2187 + }
  2188 +</style>
2074 2189 \ No newline at end of file
... ...
ceres-uniapp-master/pages_category_page1/orderModule/orderConfirm334.vue 0 → 100644
  1 +<template>
  2 + <view>
  3 + <!-- 提交订单 -->
  4 + <global-loading />
  5 +
  6 + <view v-if="ifShow">
  7 + <view class="content">
  8 + <view
  9 + class="address-box"
  10 + @click="addAddressTap"
  11 + >
  12 + <image
  13 + src="https://jy.scjysm.asia:18086/mefile/file/static/images/orderAddress.png"
  14 + class="address-img"
  15 + ></image>
  16 + <!-- 有地址的 -->
  17 + <view
  18 + class="address-r"
  19 + v-if="userAddressInfo.receiveName"
  20 + >
  21 + <view class="address-name-box">
  22 + <text>{{ userAddressInfo.receiveName }}</text>
  23 + <text class="phone">{{ userAddressInfo.receivePhone }}</text>
  24 + </view>
  25 + <view class="address-info">
  26 + <text>{{ userAddressInfo.receiveAdress }} {{ userAddressInfo.address }}</text>
  27 + </view>
  28 + </view>
  29 + <!-- 没有地址的 -->
  30 + <view
  31 + class="address-r"
  32 + v-else
  33 + >
  34 + <text>你还没有收货地址哦,点击这里添加</text>
  35 + </view>
  36 + <image
  37 + src="https://jy.scjysm.asia:18086/mefile/file/static/images/greyArrow.png"
  38 + class="arrow-right-img"
  39 + ></image>
  40 + </view>
  41 + <view class="order-list-box">
  42 + <view
  43 + class="item"
  44 + v-for="(item, sIndex) in settlement.shops"
  45 + :key="item.shopId"
  46 + >
  47 + <view class="order-list-top">
  48 + <view class="top-l">
  49 + <image
  50 + src="https://jy.scjysm.asia:18086/mefile/file/static/images/orderStoreIcon.png"
  51 + class="shop-img"
  52 + >
  53 + </image>
  54 + <text class="shop-name">{{ item.shopName }}</text>
  55 + </view>
  56 + </view>
  57 + <view class="order-info-box">
  58 + <view class="order-info">
  59 + <view
  60 + class="order-info-item"
  61 + v-for="(cItem, index) in item.skus"
  62 + :key="cItem.productId"
  63 + >
  64 + <image
  65 + :src="cItem.image"
  66 + class="product-img"
  67 + ></image>
  68 + <view class="info-box">
  69 + <text class="product-name">{{ cItem.productName }}</text>
  70 + <view class="product-sku">
  71 + <view v-for="(vItem, index) in cItem.values">
  72 + <label class="mar-left-20">{{ vItem }}</label>
  73 + </view>
  74 + </view>
  75 + <view class="price-sku-box flex-display flex-sp-between">
  76 + <view class="product-price">
  77 + <text class="fuhao">¥</text>
  78 + {{ cItem.price }}
  79 + </view>
  80 + <view class="product-num">x {{ cItem.number }}</view>
  81 + </view>
  82 + </view>
  83 + </view>
  84 + <view
  85 + v-if="item.receiveNotMatch"
  86 + class="adressTips"
  87 + >当前地址不支持配送,可更换其他地址试试
  88 + </view>
  89 + <view class="delivery-way-box">
  90 + <view>
  91 + <view class="item">
  92 + <view class="flex-items">
  93 + <text>配送方式</text>
  94 + </view>
  95 + <view class="flex-row-plus flex-items">
  96 + <text v-if="item.distribution.distributionPrice > 0">快递 ¥
  97 + {{ item.distribution.distributionPrice }}
  98 + </text>
  99 + <text v-else>快递 免邮</text>
  100 + </view>
  101 + </view>
  102 + <view class="flex-item">
  103 + <text
  104 + class="font-color-666 fs24"
  105 + v-for="(hItem, hIndex) of item.skuDiscountInfoMap"
  106 + >{{ hItem[0] }}
  107 + </text>
  108 + </view>
  109 + </view>
  110 + </view>
  111 + </view>
  112 + <view
  113 + class="discount-item1"
  114 + v-if="item.shopCoupons.length>0"
  115 + @click="showShopCoupons(item,sIndex)"
  116 + >
  117 + <view class="discount-label">店铺优惠</view>
  118 + <view class="discount-info-box flex-items">
  119 + <view
  120 + class="discount-info2"
  121 + v-if="item.currentCoupon && item.currentCoupon.couponType === 1"
  122 + >
  123 + -¥{{ item.currentCoupon.reduceMoney }}
  124 + </view>
  125 + <view
  126 + class="discount-info2"
  127 + v-if="item.currentCoupon && item.currentCoupon.couponType === 2"
  128 + >
  129 + {{ item.currentCoupon.reduceMoney }}折券
  130 + </view>
  131 + <image
  132 + class="discount-img"
  133 + src="https://jy.scjysm.asia:18086/mefile/file/static/images/arrowRight.png"
  134 + ></image>
  135 + </view>
  136 +
  137 + </view>
  138 + <view class="order-total-box">
  139 + <text class="total-num">共{{ item.number }}件</text>
  140 + <text class="total-num ml10">总计</text>
  141 + <text
  142 + class="total-price ml10"
  143 + v-if="item.totalAfterDiscount > 0"
  144 + >
  145 + ¥{{
  146 + (parseFloat(item.totalAfterDiscount) + parseFloat(item.distribution.distributionPrice || 0)).toFixed(2)
  147 + }}
  148 + </text>
  149 + <text
  150 + class="total-price ml10"
  151 + v-else
  152 + >¥0.00
  153 + </text>
  154 + </view>
  155 + </view>
  156 + </view>
  157 +
  158 + </view>
  159 + <view
  160 + class="discount-item"
  161 + @click="showDiscount"
  162 + >
  163 + <view class="discount-label">平台优惠</view>
  164 + <view class="discount-info-box flex-items">
  165 + <view
  166 + class="discount-info2"
  167 + v-if="promotionInfoDTO.couponId"
  168 + >
  169 + <text v-if="promotionInfoDTO.couponType === 2">{{ promotionInfoDTO.reduceMoney }}折</text>
  170 + <text v-else> -¥{{ promotionInfoDTO.reduceMoney | clip2Decimal }}</text>
  171 + </view>
  172 + <view
  173 + class="discount-info1"
  174 + v-else-if="couponsList.length<1"
  175 + >无
  176 + </view>
  177 + <view
  178 + class="discount-info1"
  179 + v-else
  180 + >不使用
  181 + </view>
  182 + <image
  183 + class="discount-img"
  184 + src="https://jy.scjysm.asia:18086/mefile/file/static/images/arrowRight.png"
  185 + ></image>
  186 + </view>
  187 + </view>
  188 + <!-- 积分支付-->
  189 + <view
  190 + class="integralPayBox"
  191 + v-if="integralShow"
  192 + >
  193 + <view class="integralBg">
  194 + <view class="integralTit fs26">可用{{ integralNum }}积分抵扣{{ integralPrice.toFixed(2) }}元</view>
  195 + <view class="maxIntegral">
  196 + <checkbox-group
  197 + @change="changeIntegral"
  198 + style="width: 50rpx"
  199 + >
  200 + <checkbox
  201 + style="transform:scale(0.7);"
  202 + class="integralCheckbox"
  203 + color="#C5AA7B"
  204 + value="1"
  205 + :checked="selectIntegral"
  206 + />
  207 + </checkbox-group>
  208 + </view>
  209 + </view>
  210 + </view>
  211 + <view class="cashier-box">
  212 + <CashierList :total-price="totalPrice" @change="handleChangeCashier" />
  213 + </view>
  214 + <view class="order-flow-box">
  215 + <view class="flow-word">交易流程:</view>
  216 + <view class="flow-word mt25">
  217 + <text>1、填写收货信息并完成支付</text>
  218 + <text>2、双方根据物品的交易方式进行交易</text>
  219 + <text>3、拿到物品,交易结束</text>
  220 + </view>
  221 + <!-- 实付款不含邮费,涉及邮寄双方协定好费用,提醒发起人修改价格再完成支付;-->
  222 + <view class="flow-word mt50">注:应国家邮政总局的要求,即日起涉及到个人快递包裹必须收件人实名制,否则将影响到收寄配送。请避免使用「先生,男士,小姐,女士,昵称」等模糊称谓。
  223 + </view>
  224 + </view>
  225 + </view>
  226 + <view
  227 + class="order-confirm-box"
  228 + style="padding-bottom:30upx;"
  229 + >
  230 + <view class="flex-items flex-sp-between">
  231 + <text class="num-box">共{{ totalCount }}件</text>
  232 + <view>
  233 + <text class="total">合计:</text>
  234 + <text
  235 + v-if="totalPrice>0"
  236 + class="price"
  237 + >¥{{ totalPrice.toFixed(2) }}
  238 + </text>
  239 + <text
  240 + v-else
  241 + class="price"
  242 + >¥0.00
  243 + </text>
  244 + </view>
  245 + </view>
  246 + <!-- active 当有地址时按钮加上active选中的样式-->
  247 + <button
  248 + v-if="isRegionalScope"
  249 + class="btn unActive"
  250 + type="default"
  251 + :disabled="false"
  252 + >提交订单
  253 + </button>
  254 + <button
  255 + v-else
  256 + :class="[submitActive ? 'btn active' : 'btn']"
  257 + @click="submitOrder"
  258 + >提交订单
  259 + </button>
  260 + <!-- <text class="btn" v-else>提交订单</text> -->
  261 +
  262 + </view>
  263 + <!-- 活动弹框 -->
  264 + <u-popup
  265 + class="activity-con"
  266 + v-model="isShowDiscount"
  267 + mode="bottom"
  268 + border-radius="14"
  269 + close-icon-pos="top-right"
  270 + close-icon-size="20"
  271 + >
  272 + <view
  273 + class="activity-box"
  274 + style="height: 1000rpx;"
  275 + >
  276 + <view class="title-box">
  277 + <image
  278 + class="close-btn"
  279 + @click="onDiscountClose"
  280 + src="https://jy.scjysm.asia:18086/mefile/file/static/images/close.png"
  281 + ></image>
  282 + </view>
  283 + <view class="activity-coupon-box">
  284 + <scroll-view
  285 + scroll-y="true"
  286 + style="height: 900rpx;"
  287 + >
  288 + <view class="content-box">
  289 + <view v-if="usableListLength">
  290 + <view class="label-lingqu">可用优惠券列表</view>
  291 + <view class="couponBox">
  292 + <view
  293 + class="coupon-item"
  294 + v-for="(usableItem, index) in settlement.coupons"
  295 + :key="index"
  296 + @click="couponItemTap(index, usableItem)"
  297 + >
  298 + <view
  299 + class="money-box"
  300 + v-if="usableItem.couponType === 1"
  301 + >
  302 + ¥{{ usableItem.reduceMoney }}
  303 + </view>
  304 + <view
  305 + class="money-box"
  306 + v-else
  307 + >{{ usableItem.reduceMoney }}折券
  308 + </view>
  309 + <view class="info-box">
  310 + <view
  311 + class="date font-color-999"
  312 + style="font-size:22upx; margin-top: 20upx;"
  313 + >
  314 + {{
  315 + getDate(usableItem.startTime.replace(/-/g, '.'))
  316 + }}-{{ getDate(usableItem.endTime.replace(/-/g, '.')) }}
  317 + </view>
  318 + <view class="info font-color-999">满{{ usableItem.fullMoney }}元可用</view>
  319 + </view>
  320 + <image
  321 + class="check-img"
  322 + src="https://jy.scjysm.asia:18086/mefile/file/static/images/selectActive.png"
  323 + v-if="usableItem.checked"
  324 + ></image>
  325 + <image
  326 + class="check-img"
  327 + src="https://jy.scjysm.asia:18086/mefile/file/static/images/selectEmpty.png"
  328 + v-else
  329 + >
  330 + </image>
  331 + </view>
  332 + </view>
  333 + </view>
  334 + </view>
  335 + </scroll-view>
  336 + </view>
  337 + </view>
  338 + </u-popup>
  339 + <u-popup
  340 + class="activity-con"
  341 + v-model="isShopCoupons"
  342 + mode="bottom"
  343 + border-radius="14"
  344 + close-icon-pos="top-right"
  345 + close-icon-size="20"
  346 + >
  347 + <view class="activity-box">
  348 + <view class="title-box">
  349 + <image
  350 + class="close-btn"
  351 + @click="onshopClose"
  352 + src="https://jy.scjysm.asia:18086/mefile/file/static/images/close.png"
  353 + ></image>
  354 + </view>
  355 + <view class="activity-coupon-box">
  356 + <scroll-view
  357 + scroll-y="true"
  358 + style="height: 900rpx;"
  359 + >
  360 + <view class="content-box">
  361 + <view v-if="shopCouponsLength">
  362 + <view class="label-lingqu">可用优惠券列表</view>
  363 + <view class="couponBox">
  364 + <view
  365 + class="coupon-item"
  366 + v-for="(sItem, index) in shopCouponslist.shopCoupons"
  367 + :key="sItem.id"
  368 + @click="shopCouponItemTap(index,sItem)"
  369 + >
  370 + <view
  371 + class="money-box"
  372 + v-if="sItem.couponType === 1"
  373 + >¥{{ sItem.reduceMoney }}
  374 + </view>
  375 + <view
  376 + class="money-box"
  377 + v-else
  378 + >{{ sItem.reduceMoney }}折券
  379 + </view>
  380 + <view
  381 + class="date font-color-999"
  382 + style="font-size:22upx; margin-top: 10upx;"
  383 + >
  384 + {{ getDate(sItem.startTime.replace(/-/g, '.')) }}-{{
  385 + getDate(sItem.endTime.replace(/-/g, '.'))
  386 + }}
  387 + </view>
  388 + <view class="info-box">
  389 + <view class="info font-color-999">满{{ sItem.fullMoney }}元可用</view>
  390 + </view>
  391 + <image
  392 + class="check-img"
  393 + src="https://jy.scjysm.asia:18086/mefile/file/static/images/selectActive.png"
  394 + v-if="sItem.checked"
  395 + ></image>
  396 + <image
  397 + class="check-img"
  398 + src="https://jy.scjysm.asia:18086/mefile/file/static/images/selectEmpty.png"
  399 + v-else
  400 + >
  401 + </image>
  402 + </view>
  403 + </view>
  404 + </view>
  405 + </view>
  406 + </scroll-view>
  407 + </view>
  408 + </view>
  409 + </u-popup>
  410 + </view>
  411 + </view>
  412 +</template>
  413 +
  414 +<script>
  415 +import { hidden } from "../../utils/hidden";
  416 +import { handleDoPay } from "../../utils/payUtil";
  417 +
  418 +const NET = require('../../utils/request')
  419 +const API = require('../../config/api')
  420 +import CashierList from "../../components/CashierList";
  421 +export default {
  422 + components:{CashierList},
  423 + data() {
  424 + return {
  425 + // 埋点ID
  426 + pointProductIds: '',
  427 + couponActiveShowFalg: false,
  428 + settlement: {},
  429 + type: 0,
  430 + skuItemDTOList: [],
  431 + userAddressInfo: {},
  432 + isShowDiscount: false,
  433 + isShopCoupons: false,
  434 + usableListLength: 0,
  435 + shopCouponsLength: 0,
  436 + shopCouponslist: [],
  437 + promotionInfoDTO: {
  438 + couponId: 0,
  439 + ifAdd: 1,
  440 + reduceMoney: 0
  441 + },
  442 + shopInfoDTO: {},
  443 + reduceMoney: 0,
  444 + submitActive: true,
  445 + distributionPrice: 0, //运费
  446 + totalPrice: 0, //合计
  447 + receiveId: '',
  448 + totalCount: 0,
  449 + skuItemList: {},
  450 + shopGroupWorkId: 0,
  451 + sumitType: '',
  452 + collageId: null,
  453 + couponIfAdd: true,
  454 + couponsList: [],
  455 + shopCouIndex: 0, //优惠券index
  456 + shopIndex: 0,
  457 + shopCheckedType: true,
  458 + discountPrice: 0,
  459 + selectShopCoupon: [], // 已选择店铺优惠券
  460 + huabeiDetail: true,
  461 + showHuabeiPopup: false,
  462 + huabeiChargeType: 0,
  463 + huabeiFeerateList: [],
  464 + paymentMode: 0, //支付方式 1-微信支付 2-支付宝支付 3-花呗分期
  465 + huabeiPeriod: 3, //选择的花呗分期数 有 3 6 12 3种选项,默认是3
  466 + chargeFeeList: [], //花呗每期的手续费
  467 + fenqiFeeList: [], //花呗每期的支付额
  468 + showWechatPayType: false,
  469 + showAlipayPayType: false,
  470 + showHuabeiPayType: false,
  471 + orderId: null,
  472 + couponType: 0,
  473 + selectIntegral: true,
  474 + integralNum: 0,
  475 + ifShow: false,
  476 + integralRatio: 0, // 积分兑换比例
  477 + integralPrice: 0, // 总积分可减多少元
  478 + orderCreditThreshold: 0, // 满多少元可以抵扣
  479 + integralShow: false, // 显示隐藏积分
  480 + checkedPlatformCoupon: undefined,
  481 + oneClickSubmit: true, //只提交订单一次
  482 + isRegionalScope: false, //是否在商家配置范围内地址
  483 + payObj:{} // 支付相关
  484 + }
  485 + },
  486 + onLoad(options) {
  487 + this.getQuery()
  488 + console.log(options, 'options')
  489 + this.type = options.type
  490 + if (options.receiveId) {
  491 + this.receiveId = options.receiveId
  492 + }
  493 + },
  494 + onShow() {
  495 + if (uni.getStorageSync("receiveItem")) {
  496 + this.receiveId = uni.getStorageSync("receiveItem").receiveId
  497 + }
  498 + if (uni.getStorageSync("skuItemDTOList") != "") {
  499 + this.skuItemDTOList = uni.getStorageSync('skuItemDTOList')
  500 + console.log(this.skuItemDTOList, '66666')
  501 + if (this.skuItemDTOList[0].shopDiscountId > 0) {
  502 + this.sumitType = 4
  503 + } else if (this.skuItemDTOList[0].shopSeckillId > 0) {
  504 + this.sumitType = 3
  505 + }
  506 + this.getSettlement(false)
  507 + } else if (uni.getStorageSync("skuItemList") != "") {
  508 + this.skuItemList = uni.getStorageSync("skuItemList")
  509 + //console.log(this.skuItemList, 999)
  510 + this.shopGroupWorkId = this.skuItemList.shopGroupWorkId
  511 + this.sumitType = this.skuItemList.type
  512 + this.collageId = this.skuItemList.collageId
  513 + this.getSettlement(true)
  514 + }
  515 + },
  516 + onBackPress(e) {
  517 + if (e.from === 'navigateBack') {
  518 + return false;
  519 + }
  520 + this.back();
  521 + return true
  522 + },
  523 + filters: {
  524 + clip2Decimal(value) {
  525 + if (value === undefined || value === null) {
  526 + return "0.00"
  527 + }
  528 + return (parseInt(value * 100) / 100).toFixed(2)
  529 + }
  530 + },
  531 + methods: {
  532 + getQuery() {
  533 + NET.request(API.Query, {
  534 + name: 'credit_exchange_rate'
  535 + }, 'GET').then(res => {
  536 + this.integralRatio = parseFloat(res.data.dictDescribe)
  537 + }).catch(res => {
  538 + console.log('平台端未配置积分兑换比例(1积分抵扣多少金额)')
  539 + })
  540 + },
  541 + // 积分价格计算
  542 + changeIntegral() {
  543 + this.selectIntegral = !this.selectIntegral
  544 + if (this.selectIntegral) {
  545 + this.totalPrice = this.totalPrice - this.integralPrice
  546 + } else {
  547 + this.totalPrice = this.totalPrice + this.integralPrice
  548 + }
  549 + },
  550 + back() {
  551 + if (this.type == 2 || this.type) {
  552 + uni.switchTab({
  553 + url: '../../pages/tabbar/cart/index'
  554 + })
  555 + } else {
  556 + uni.navigateBack({
  557 + delta: 1
  558 + });
  559 + }
  560 + },
  561 + // 获取订单信息
  562 + getSettlement(isGroup) {
  563 + uni.showLoading({
  564 + title: '加载中...',
  565 + })
  566 + this.ifShow = true
  567 + let _url = '',
  568 + _data = ''
  569 + // 是否是拼团
  570 + if (isGroup) {
  571 + _url = API.getGroupSettlement
  572 + _data = this.skuItemList
  573 + } else {
  574 + _url = API.Settlement
  575 + _data = {
  576 + type: this.type,
  577 + shops: this.skuItemDTOList,
  578 + receiveId: this.receiveId
  579 + }
  580 + // composeId: 68
  581 + console.log(this.skuItemDTOList, 'this.skuItemDTOList')
  582 + }
  583 + NET.request(_url, _data, 'POST').then(res => {
  584 + uni.hideLoading()
  585 + this.settlement = res.data
  586 + this.couponsList = res.data.coupons
  587 + this.huabeiChargeType = res.data.huabeiChargeType
  588 + if (this.huabeiChargeType === 2) {
  589 + this.huabeiFeerateList = res.data.huabeiFeerateList
  590 + } else {
  591 + this.huabeiFeerateList = [0, 0, 0]
  592 + }
  593 + let shopLen = this.settlement.shops.length
  594 + this.settlement.shops.forEach((value) => {
  595 + value['totalNum'] = value.total
  596 + value['pricing'] = 0
  597 + })
  598 + // 如果没有地址时进入购买宝贝页面对下面的商品件数和总计进行赋值
  599 + if (!this.settlement.receive.receiveAdress) {
  600 + this.settlement.shops.map(item => {
  601 + this.totalCount += item.number
  602 + this.totalPrice += item.total || item.totalNum
  603 + })
  604 + }
  605 + // 初始化平台券选中状态
  606 + if (this.settlement.coupons.length > 0) {
  607 + this.settlement.coupons.forEach((item) => {
  608 + item.checked = false
  609 + })
  610 + }
  611 + this.settlement.shops.forEach((item) => {
  612 + item.totalAfterDiscount = item.total
  613 + })
  614 + // 默认选中商家的第一张优惠券
  615 + for (let s = 0; s < shopLen; s++) {
  616 + const curShop = this.settlement.shops[s]
  617 + curShop.skus.forEach((item) => {
  618 + item['skuTotalNum'] = item.total
  619 + })
  620 + if (curShop.shopCoupons.length > 0) {
  621 + curShop.shopCoupons.forEach((item) => {
  622 + item.checked = false
  623 + })
  624 + const firstShopCoupon = curShop.shopCoupons[0];
  625 + this.shopCouponItemTap(0, firstShopCoupon)
  626 +
  627 + /*let useCoupon = this.useShopCoupon(s, 0)
  628 + if (useCoupon) {
  629 + firstShopCoupon.checked = true
  630 + this.selectShopCoupon.push(firstShopCoupon)
  631 + curShop['currentCoupon'] = firstShopCoupon
  632 + } else {
  633 + curShop.totalNum = curShop.total
  634 + }*/
  635 + }
  636 + }
  637 +
  638 + if (uni.getStorageSync('receiveItem')) {
  639 + let receiveItem = uni.getStorageSync('receiveItem')
  640 + this.userAddressInfo = receiveItem
  641 + this.receiveId = receiveItem.receiveId
  642 + this.userAddressInfo.receivePhone = hidden(this.userAddressInfo.receivePhone, 3, 4)
  643 + } else if (res.data.receive) {
  644 + this.receiveId = res.data.receive.receiveId
  645 + this.userAddressInfo = res.data.receive
  646 + this.userAddressInfo.receivePhone = hidden(this.userAddressInfo.receivePhone, 3, 4)
  647 + }
  648 + uni.removeStorageSync('receiveItem')
  649 + this.usableListLength = res.data.coupons.length
  650 + this.isReceiveCan()
  651 + this.getTotal()
  652 + console.error(this.settlement)
  653 + }).catch(res => {
  654 + uni.hideLoading()
  655 + })
  656 + },
  657 + // 根据地址判断是否能下单
  658 + isReceiveCan() {
  659 + this.settlement.shops.map(item => {
  660 + if (item.receiveNotMatch) {
  661 + this.isRegionalScope = item.receiveNotMatch
  662 + }
  663 + if (this.isRegionalScope) {
  664 + uni.showToast({
  665 + title: '当前地址不支持配送,请参与红色字提示',
  666 + icon: 'none'
  667 + })
  668 + }
  669 + })
  670 + },
  671 +
  672 + addAddressTap() {
  673 + uni.navigateTo({
  674 + url: '../../pages_category_page2/userModule/address?type=' + this.type,
  675 + })
  676 + },
  677 + getDate(time) {
  678 + if (!time) return '';
  679 + return time.split(' ')[0]
  680 + },
  681 + // 平台优惠券选择
  682 + couponItemTap(index, coupon) {
  683 + if (!coupon.checked && this.selectShopCoupon.length) { // 判断商家券情况
  684 + uni.showToast({
  685 + title: '不可与商家券叠加使用!',
  686 + icon: 'none'
  687 + })
  688 + return false
  689 + }
  690 + // 已选中的情况下取消选中
  691 + if (coupon.checked) {
  692 + let promotionInfoDTO = {}
  693 + if (coupon.couponId) {
  694 + promotionInfoDTO['couponId'] = 0
  695 + promotionInfoDTO['ifAdd'] = 1
  696 + promotionInfoDTO['reduceMoney'] = 0
  697 + }
  698 + this.promotionInfoDTO = promotionInfoDTO
  699 + coupon.checked = false
  700 + this.isShowDiscount = false
  701 + this.checkedPlatformCoupon = undefined
  702 + this.settlement.shops.forEach(shopItem => {
  703 + if (shopItem.skus) {
  704 + shopItem.skus.forEach(skuItem => {
  705 + skuItem.buyerCouponId = null
  706 + })
  707 + }
  708 + })
  709 + this.getTotal()
  710 + } else {
  711 + // 先把所有已选中的平台优惠券改为未选中
  712 + this.settlement.coupons.forEach((item) => {
  713 + item.checked = false
  714 + })
  715 + let totalPrice = 0 // 订单总价
  716 + let shopsLen = this.settlement.shops.length // 结算页店铺数量
  717 + let matchCouponSkuList = []
  718 + for (let i = 0; i < shopsLen; i++) {
  719 + let matchCouponNormalPrice = 0
  720 + let priceCount = 0
  721 + const curShop = this.settlement.shops[i]
  722 + let skuLen = curShop.skus.length
  723 + let tmpPriceSkuList = []
  724 + for (let j = 0; j < skuLen; j++) {
  725 + const curSku = curShop.skus[j]
  726 + if (curSku.priceId > 0) {
  727 + priceCount++
  728 + }
  729 + const ids = coupon.ids
  730 + if (ids.indexOf(curSku.productId) > -1) {
  731 + if (curSku.priceId > 0) {
  732 + tmpPriceSkuList.push(curSku)
  733 + } else {
  734 + matchCouponSkuList.push(curSku)
  735 + matchCouponNormalPrice = matchCouponNormalPrice + curSku.price * curSku.number
  736 + }
  737 + }
  738 + }
  739 + if (priceCount === tmpPriceSkuList.length) {
  740 + totalPrice += curShop.priceAfterDiscount
  741 + matchCouponSkuList = matchCouponSkuList.concat(tmpPriceSkuList)
  742 + }
  743 + totalPrice += matchCouponNormalPrice
  744 + }
  745 + if (this.settlement.shops[this.shopIndex].total < coupon.fullMoney) {
  746 + uni.showToast({
  747 + title: '不满足优惠券使用条件!',
  748 + icon: 'none'
  749 + })
  750 + return false
  751 + }
  752 + if (coupon.couponType === 1 && coupon.reduceMoney >= totalPrice) {
  753 + uni.showToast({
  754 + title: '不可使用大于等于合计金额的优惠劵!',
  755 + icon: 'none'
  756 + })
  757 + return false
  758 + }
  759 + // 如果是折扣券,需要记录,在什么基数上打折
  760 + coupon.useMoney = totalPrice
  761 + let promotionInfoDTO = {}
  762 + if (coupon.couponId) {
  763 + promotionInfoDTO['couponId'] = coupon.couponId
  764 + promotionInfoDTO['ifAdd'] = coupon.ifAdd
  765 + promotionInfoDTO['couponType'] = coupon.couponType
  766 + promotionInfoDTO['reduceMoney'] = coupon.reduceMoney
  767 + }
  768 + this.promotionInfoDTO = promotionInfoDTO
  769 + this.isShowDiscount = false
  770 + this.checkedPlatformCoupon = coupon
  771 + matchCouponSkuList.forEach(item => {
  772 + item.buyerCouponId = coupon.couponId
  773 + })
  774 + this.getTotal()
  775 + // 选中优惠券
  776 + coupon.checked = true
  777 + }
  778 + },
  779 + // 店铺优惠券选择
  780 + shopCouponItemTap(index, coupon) {
  781 + console.log(index,coupon.checked)
  782 + // 取消选择优惠券
  783 + if (coupon.checked) {
  784 + coupon.checked = false
  785 + this.settlement.shops[this.shopIndex].totalAfterDiscount = this.settlement.shops[this.shopIndex].total
  786 + this.settlement.shops[this.shopIndex].currentCoupon = {}
  787 + this.settlement.shops[this.shopIndex].skus.forEach(item => {
  788 + item.buyerShopCouponId = null
  789 + })
  790 + this.isShopCoupons = false
  791 + this.selectShopCoupon = []
  792 + this.getTotal()
  793 + return false
  794 + }
  795 + if (this.settlement.shops[this.shopIndex].total < coupon.fullMoney) {
  796 + uni.showToast({
  797 + title: '不满足优惠券使用条件!',
  798 + icon: 'none'
  799 + })
  800 + } else if (coupon.couponType === 1 && this.settlement.shops[this.shopIndex].total < coupon.reduceMoney) {
  801 + uni.showToast({
  802 + title: '不可使用大于商品金额的优惠劵!',
  803 + icon: 'none'
  804 + })
  805 + } else {
  806 + // 选择优惠券
  807 + if (this.promotionInfoDTO.couponId !== 0) {
  808 + uni.showToast({
  809 + title: '此券不可与平台券叠加!',
  810 + icon: 'none'
  811 + })
  812 + return false
  813 + }
  814 + if (coupon.couponType === 1) {
  815 + if (coupon.reduceMoney >= this.settlement.shops[this.shopIndex].total) {
  816 + uni.showToast({
  817 + title: '优惠券优惠金额不能大于等于合计金额!',
  818 + icon: 'none'
  819 + })
  820 + return false
  821 + }
  822 + }
  823 +
  824 + this.isShopCoupons = false
  825 + let useCoupon = this.useShopCoupon(this.shopIndex, index)
  826 + console.log(useCoupon)
  827 + if (useCoupon) {
  828 + // 确认使用当前点击的商家券,先将所有的商家券取消选中
  829 + for (let i = 0; i < this.selectShopCoupon.length; i++) {
  830 + this.selectShopCoupon[i].checked = false
  831 + }
  832 + this.selectShopCoupon = []
  833 +
  834 + coupon.checked = true
  835 + this.settlement.shops[this.shopIndex].currentCoupon = coupon
  836 + this.settlement.shops[this.shopIndex].skus.forEach(item => {
  837 + if (item.buyerShopCouponId > 0 && item.buyerShopCouponId !== coupon.shopCouponId) {
  838 + item.buyerShopCouponId = null
  839 + }
  840 + })
  841 + this.selectShopCoupon.push(coupon)
  842 + } else {
  843 + this.settlement.shops[this.shopIndex].totalAfterDiscount = this.settlement.shops[this.shopIndex].total
  844 + }
  845 + this.getTotal()
  846 + }
  847 + },
  848 + useShopCoupon(shopIndex, couponIndex) {
  849 + const curShop = this.settlement.shops[shopIndex]
  850 + curShop.totalAfterDiscount = 0
  851 + let curCoupon
  852 + if (curShop.shopCoupons && curShop.shopCoupons.length > 0) {
  853 + curCoupon = curShop.shopCoupons[couponIndex]
  854 + }
  855 + if (!curCoupon) {
  856 + return false
  857 + }
  858 + let useCoupon = false
  859 + let matchCouponNormalSkuList = []
  860 + let matchCouponPriceSkuList = []
  861 + if (curCoupon.applyType !== 1) {
  862 + const ids = curCoupon.ids
  863 + let skuLength = curShop.skus.length
  864 + // 符合优惠券商品列表中的普通sku价格综合
  865 +
  866 + let matchCouponNormalPrice = 0
  867 + // 符合定价捆绑且在优惠券商品列表中的价格综合
  868 + let matchCouponPricePrice = 0
  869 + // 符合定价捆绑活动的sku数量
  870 + let priceCount = 0
  871 + for (let idx = 0; idx < skuLength; idx++) {
  872 + let curSku = curShop.skus[idx]
  873 + if (curSku.priceId > 0) {
  874 + priceCount++
  875 + }
  876 + if (ids.indexOf(curSku.productId) > -1) {
  877 + if (curSku.priceId > 0) {
  878 + matchCouponPriceSkuList.push(curSku)
  879 + } else {
  880 + matchCouponNormalSkuList.push(curSku)
  881 + matchCouponNormalPrice = matchCouponNormalPrice + curSku.price * curSku.number
  882 + }
  883 + }
  884 + }
  885 + // 如果定价捆绑的所有sku都符合优惠券
  886 + if (priceCount === matchCouponPriceSkuList.length) {
  887 + matchCouponPricePrice = curShop.priceAfterDiscount
  888 + }
  889 + // 符合的sku的price加起来是否满足满减的条件
  890 + const priceFinal = matchCouponPricePrice + matchCouponNormalPrice
  891 + if (priceFinal < curCoupon.fullMoney || (curCoupon.couponType === 1 && priceFinal <= curCoupon
  892 + .reduceMoney)) {
  893 + return false
  894 + }
  895 + // 判断是满减,还是折扣
  896 + if (curCoupon.couponType === 1) {
  897 + curShop.totalAfterDiscount = curShop.total - curCoupon.reduceMoney
  898 + useCoupon = true
  899 + } else {
  900 + // 打折后优惠抵扣的金额
  901 + let priceDiscount = (priceFinal * ((10 - curCoupon.reduceMoney) / 10)).toFixed(2)
  902 + let tmpTotal = curShop.total - priceDiscount
  903 + if (tmpTotal.toFixed(2) >= 0.01) {
  904 + curShop.totalAfterDiscount = tmpTotal.toFixed(2)
  905 + useCoupon = true
  906 + }
  907 + }
  908 + if (useCoupon) {
  909 + // 满足的sku设置buyerShopCouponId
  910 + if (priceCount === matchCouponPriceSkuList.length) {
  911 + let length1 = matchCouponPriceSkuList.length
  912 + for (let idx = 0; idx < length1; idx++) {
  913 + matchCouponPriceSkuList[idx].buyerShopCouponId = curCoupon.shopCouponId
  914 + }
  915 + }
  916 + let length2 = matchCouponNormalSkuList.length
  917 + for (let idx = 0; idx < length2; idx++) {
  918 + matchCouponNormalSkuList[idx].buyerShopCouponId = curCoupon.shopCouponId
  919 + }
  920 + }
  921 + } else {
  922 + if (curCoupon.couponType === 1) {
  923 + if (curShop.total > curCoupon.reduceMoney) {
  924 + curShop.totalAfterDiscount = curShop.total - curCoupon.reduceMoney
  925 + useCoupon = true
  926 + }
  927 + } else {
  928 + if (curShop.total > curCoupon.fullMoney) {
  929 + let priceDiscount = (curShop.total * ((10 - curCoupon.reduceMoney) / 10)).toFixed(2)
  930 + let tmpTotal = curShop.total - priceDiscount
  931 + if (tmpTotal.toFixed(2) >= 0.01) {
  932 + curShop.totalAfterDiscount = tmpTotal.toFixed(2)
  933 + useCoupon = true
  934 + }
  935 + }
  936 + }
  937 + if (useCoupon) {
  938 + let skuLength = curShop.skus.length
  939 + for (let idx = 0; idx < skuLength; idx++) {
  940 + curShop.skus[idx].buyerShopCouponId = curCoupon.shopCouponId
  941 + }
  942 + }
  943 + }
  944 + return useCoupon
  945 + },
  946 + /**
  947 + * 计算总价,商家券的优惠计算,在调用本方法之前已经计算好在shops[].totalAfterDiscount
  948 + */
  949 + getTotal() {
  950 + this.totalPrice = 0
  951 + this.totalCount = 0
  952 + this.integralPrice = 0
  953 + this.integralNum = 0
  954 + let shopSumPrice = 0
  955 + let shopsLen = this.settlement.shops.length
  956 + console.log(this.settlement, 'fsfsfs')
  957 + for (let i = 0; i < shopsLen; i++) {
  958 + this.totalPrice += parseFloat(this.settlement.shops[i].totalAfterDiscount)
  959 + shopSumPrice += parseFloat(this.settlement.shops[i].totalAfterDiscount)
  960 + this.totalCount += this.settlement.shops[i].number
  961 + }
  962 +
  963 + if (this.checkedPlatformCoupon) {
  964 + const couponType = this.checkedPlatformCoupon.couponType
  965 + const reduceMoney = this.checkedPlatformCoupon.reduceMoney
  966 + if (couponType === 1 && this.totalPrice - reduceMoney > 0) { // 满减
  967 + this.totalPrice = shopSumPrice - reduceMoney
  968 + } else if (couponType === 2 && reduceMoney > 0) { // 折扣
  969 + const useMoney = this.checkedPlatformCoupon.useMoney
  970 + this.totalPrice = (shopSumPrice - useMoney) + useMoney * reduceMoney / 10
  971 + }
  972 + }
  973 + // 积分支付计算
  974 + this.calcCredit()
  975 + // 加上每个商家的运费
  976 + this.settlement.shops.forEach((item) => {
  977 + this.totalPrice = this.totalPrice + (item.distribution.distributionPrice || 0)
  978 + })
  979 + //this.recalcHuabei()
  980 + },
  981 + calcCredit() {
  982 + let shopsLen = this.settlement.shops.length
  983 + const skuRemainMap = this.calcSkuRemainMap()
  984 + const skuCreditMap = this.settlement.skuCreditMap;
  985 + if (skuCreditMap && this.integralRatio > 0) {
  986 + this.orderCreditThreshold = this.settlement.orderCreditThreshold
  987 + let remainUserCredit = this.settlement.userTotalCredit
  988 + let remainTotalPrice = Math.round((this.totalPrice + Number.EPSILON) * 100) / 100
  989 + let remainDeductLimit = this.settlement.creditDeductLimit
  990 + // 只有订单金额达到阈值,并且用户还有剩余的积分,才能进行积分抵扣
  991 + if (this.totalPrice >= this.orderCreditThreshold && remainUserCredit > 0 && remainDeductLimit > 0) {
  992 + for (let i = 0; i < shopsLen; i++) {
  993 + const curShop = this.settlement.shops[i]
  994 + let skuLen = curShop.skus.length
  995 + for (let j = 0; j < skuLen; j++) {
  996 + const curSku = curShop.skus[j]
  997 + const skuId = curSku.skuId
  998 + if (skuCreditMap[skuId] > 0 && skuRemainMap[skuId] > 0 && remainUserCredit > 0 &&
  999 + remainTotalPrice > 0) {
  1000 + // 抵扣之后,必须保证整个订单至少还有0.01元,可用于支付
  1001 + if (remainTotalPrice - skuRemainMap[skuId] < 0.01) {
  1002 + skuRemainMap[skuId] -= 0.01
  1003 + }
  1004 + // 按照比例换算成需要多少积分抵扣(取整)
  1005 + let finalSkuCredit = parseInt((skuRemainMap[skuId] / this.integralRatio).toString());
  1006 + // 优先以商家配置的商品可抵扣积分为准
  1007 + if (skuCreditMap[skuId] < finalSkuCredit) {
  1008 + finalSkuCredit = skuCreditMap[skuId]
  1009 + }
  1010 + // 不能超过用户剩余积分
  1011 + if (remainUserCredit < finalSkuCredit) {
  1012 + finalSkuCredit = remainUserCredit
  1013 + }
  1014 + // 不能超过整个订单可抵扣积分
  1015 + if (remainDeductLimit < finalSkuCredit) {
  1016 + finalSkuCredit = remainDeductLimit
  1017 + }
  1018 + curSku.cachedCredit = finalSkuCredit
  1019 + this.integralNum += finalSkuCredit
  1020 + remainUserCredit -= finalSkuCredit
  1021 + remainDeductLimit -= finalSkuCredit
  1022 + remainTotalPrice -= finalSkuCredit
  1023 + }
  1024 + }
  1025 + }
  1026 + }
  1027 + //计算抵扣价格
  1028 + if (this.integralNum !== 0) {
  1029 + this.integralNum = parseInt(this.integralNum)
  1030 + this.integralPrice = this.integralNum * this.integralRatio
  1031 + if (this.integralNum !== 0) {
  1032 + this.integralShow = true
  1033 + }
  1034 + if (this.selectIntegral) {
  1035 + this.totalPrice = this.totalPrice - this.integralPrice
  1036 + }
  1037 + } else {
  1038 + this.integralShow = false
  1039 + }
  1040 + }
  1041 + },
  1042 + /**
  1043 + * 计算sku在整个运单价格中的剩余价值 1元的订单,打1折优惠之后,剩余价值就是0.1元
  1044 + */
  1045 + calcSkuRemainMap() {
  1046 + let skuRemainMap = {}
  1047 + let shopsLen = this.settlement.shops.length
  1048 + const skuCreditMap = this.settlement.skuCreditMap
  1049 + for (let i = 0; i < shopsLen; i++) {
  1050 + const curShop = this.settlement.shops[i]
  1051 + let skuLen = curShop.skus.length
  1052 + let checkedShopCoupon = undefined
  1053 + curShop.shopCoupons.forEach((item) => {
  1054 + if (item.checked) {
  1055 + checkedShopCoupon = item
  1056 + }
  1057 + })
  1058 + for (let j = 0; j < skuLen; j++) {
  1059 + const curSku = curShop.skus[j]
  1060 + const skuId = curSku.skuId
  1061 + // 不是定价捆绑,并且有配置可抵扣的积分,才有必要计算比例
  1062 + if (!curSku.priceId > 0 && skuCreditMap[skuId] > 0) {
  1063 + let remainSkuMoney = curSku.price * curSku.number
  1064 + if (checkedShopCoupon) {
  1065 + let skuShopPercent = remainSkuMoney / curShop.total
  1066 + let curReduceMoney = 0
  1067 + if (checkedShopCoupon.couponType === 1) {
  1068 + curReduceMoney = checkedShopCoupon.reduceMoney * skuShopPercent
  1069 + } else {
  1070 + curReduceMoney = remainSkuMoney * (10 - checkedShopCoupon.reduceMoney) / 10
  1071 + }
  1072 + remainSkuMoney = remainSkuMoney - curReduceMoney
  1073 + }
  1074 + // 使用平台券
  1075 + if (this.checkedPlatformCoupon && remainSkuMoney > 0) {
  1076 + // 满减
  1077 + if (this.checkedPlatformCoupon.couponType === 1) {
  1078 + let skuTotalPercent = remainSkuMoney / this.totalPrice
  1079 + remainSkuMoney -= this.checkedPlatformCoupon.reduceMoney * skuTotalPercent
  1080 + }
  1081 + // 折扣
  1082 + else {
  1083 + remainSkuMoney = remainSkuMoney * this.checkedPlatformCoupon.reduceMoney / 10
  1084 + }
  1085 + }
  1086 + skuRemainMap[skuId] = remainSkuMoney
  1087 + }
  1088 + }
  1089 + }
  1090 + return skuRemainMap
  1091 + },
  1092 + // 展示平台端优惠券
  1093 + showDiscount() {
  1094 + // let shopifAdd = 1
  1095 + // if(this.settlement.shops[this.shopIndex].shopCoupons.length>0){
  1096 + // shopifAdd = this.settlement.shops[this.shopIndex].shopCoupons[this.shopCouIndex].ifAdd
  1097 + // }
  1098 + if (this.settlement.coupons.length > 0) {
  1099 + for (let i = 0; i < this.selectShopCoupon.length; i++) {
  1100 + if (this.selectShopCoupon[i].ifAdd == 0) {
  1101 + uni.showToast({
  1102 + title: '不可叠加已选择的店铺券',
  1103 + icon: 'none'
  1104 + })
  1105 + return false
  1106 + }
  1107 + }
  1108 + this.isShowDiscount = true
  1109 + } else {
  1110 + uni.showToast({
  1111 + title: '暂无可用优惠券',
  1112 + icon: 'none'
  1113 + })
  1114 + }
  1115 + },
  1116 + // 显示店铺优惠券
  1117 + showShopCoupons(item, sIndex) {
  1118 + if (item.shopCoupons.length > 0) {
  1119 + this.isShopCoupons = true
  1120 + this.shopCouponslist = item
  1121 + this.shopCouponsLength = item.shopCoupons.length
  1122 + this.shopIndex = sIndex
  1123 + } else {
  1124 + uni.showToast({
  1125 + title: '暂无可用优惠券',
  1126 + icon: 'none'
  1127 + })
  1128 + }
  1129 + },
  1130 + onDiscountClose() {
  1131 + this.isShowDiscount = false
  1132 + },
  1133 + onshopClose() {
  1134 + this.isShopCoupons = false
  1135 + },
  1136 +
  1137 +
  1138 + /**
  1139 + * 检查提交表单
  1140 + * @return {boolean}
  1141 + */
  1142 + handleCheckOrderForm() {
  1143 + if (!this.payObj.paymentMode) {
  1144 + uni.showToast({
  1145 + title: '请选择支付方式',
  1146 + icon: 'none'
  1147 + })
  1148 + return false
  1149 + }
  1150 + if (!this.oneClickSubmit) {
  1151 + uni.showToast({
  1152 + title: "已提交,请勿重新操作!",
  1153 + icon: 'none'
  1154 + })
  1155 + return false
  1156 + }
  1157 + if (!this.userAddressInfo.receiveName) {
  1158 + uni.showToast({
  1159 + icon: 'none',
  1160 + title: '请选择收货地址'
  1161 + })
  1162 + return false
  1163 + }
  1164 + this.oneClickSubmit = false
  1165 + return true
  1166 + },
  1167 +
  1168 + /**
  1169 + * 支付更改事件
  1170 + * @param params
  1171 + */
  1172 + handleChangeCashier(params){
  1173 + this.payObj = params
  1174 + console.log(params)
  1175 + },
  1176 +
  1177 + /**
  1178 + * 组装结算数据
  1179 + */
  1180 + handlePackageData() {
  1181 + uni.showLoading({
  1182 + mask: true,
  1183 + title: '订单提交中...',
  1184 + })
  1185 + let couponIdinfo = 0
  1186 + if (this.promotionInfoDTO.couponId) {
  1187 + couponIdinfo = this.promotionInfoDTO.couponId
  1188 + }
  1189 + let data = {
  1190 + shopDiscountId: null,
  1191 + collageId: this.collageId,
  1192 + type: this.sumitType,
  1193 + shopGroupWorkId: null,
  1194 + receiveId: this.receiveId,
  1195 + couponId: couponIdinfo,
  1196 + price: this.totalPrice,
  1197 + remark: "",
  1198 + shops: [],
  1199 + discountPrice: this.discountPrice,
  1200 + shopSeckillId: null
  1201 + }
  1202 +
  1203 + if (this.shopGroupWorkId > 0) {
  1204 + data.shopGroupWorkId = this.shopGroupWorkId
  1205 + }
  1206 +
  1207 + if (this.skuItemDTOList != '') {
  1208 + if (this.skuItemDTOList[0].shopDiscountId > 0) {
  1209 + data.shopDiscountId = this.skuItemDTOList[0].shopDiscountId
  1210 + } else if (this.skuItemDTOList[0].shopSeckillId > 0) {
  1211 + data.shopSeckillId = this.skuItemDTOList[0].shopSeckillId
  1212 + }
  1213 + }
  1214 + let datashopslen = this.settlement.shops.length
  1215 + for (let n = 0; n < datashopslen; n++) {
  1216 + let shopsobj = {}
  1217 + shopsobj["shopId"] = this.settlement.shops[n].shopId
  1218 + shopsobj["sceneId"] = this.settlement.shops[n].sceneId
  1219 + shopsobj["distribution"] = {}
  1220 + shopsobj["skus"] = []
  1221 + if (this.settlement.shops[n].currentCoupon) {
  1222 + shopsobj["id"] = this.settlement.shops[n].currentCoupon.id
  1223 + }
  1224 + data.shops.push(shopsobj)
  1225 + data.shops[n].distribution.distributionPrice = this.settlement.shops[n].distribution.distributionPrice
  1226 + data.shops[n].distribution.distributionName = this.settlement.shops[n].distribution.distributionName
  1227 + let dataskuslen = this.settlement.shops[n].skus.length
  1228 + for (let m = 0; m < dataskuslen; m++) {
  1229 + let skusobj = {}
  1230 + const curSku = this.settlement.shops[n].skus[m]
  1231 + skusobj["skuId"] = curSku.skuId
  1232 + skusobj["number"] = curSku.number
  1233 + skusobj["ifLogistics"] = curSku.ifLogistics
  1234 + skusobj["selected"] = curSku.selected
  1235 + skusobj["platformSeckillId"] = curSku.platformSeckillId
  1236 + skusobj["platformDiscountId"] = curSku.platformDiscountId
  1237 + skusobj["shopSeckillId"] = curSku.shopSeckillId
  1238 + skusobj["shopDiscountId"] = curSku.shopDiscountId
  1239 + skusobj["sceneId"] = curSku.sceneId
  1240 + skusobj["priceId"] = curSku.priceId
  1241 + skusobj["useMember"] = curSku.useMember
  1242 + skusobj["composeId"] = curSku.composeId
  1243 + // 处理埋点id
  1244 + this.pointProductIds += curSku.productId + ','
  1245 + // 积分传参
  1246 + if (this.selectIntegral && curSku.cachedCredit) {
  1247 + skusobj["useCredit"] = curSku.cachedCredit
  1248 + skusobj["useCreditAmount"] = (curSku.cachedCredit * this.integralRatio).toFixed(2)
  1249 + }
  1250 + data.shops[n].skus.push(skusobj)
  1251 + }
  1252 + }
  1253 +
  1254 + // 去除最后一个,
  1255 + if (this.pointProductIds.endsWith(',')) {
  1256 + this.pointProductIds = this.pointProductIds.slice(0, -1)
  1257 + }
  1258 + this.handleSetPayMode(data)
  1259 + uni.hideLoading()
  1260 + return data
  1261 + },
  1262 +
  1263 + /**
  1264 + * 根据环境设置下单的支付信息
  1265 + * @param data handlePackageData返回值
  1266 + */
  1267 + handleSetPayMode(data){
  1268 + // subPaymentMode 1-小程序支付 2-app支付 3-H5支付
  1269 + // paymentMode 1-微信 2-支付宝
  1270 + data.paymentMode = this.payObj.paymentMode
  1271 + // #ifdef H5
  1272 + data.subPaymentMode = 3
  1273 + // #endif
  1274 +
  1275 + // #ifdef MP-WEIXIN
  1276 + data.subPaymentMode = 1
  1277 + // #endif
  1278 +
  1279 + // #ifdef APP-PLUS
  1280 + data.paymentMode = 1
  1281 + // #endif
  1282 + // #ifdef MP-ALIPAY
  1283 + data.subPaymentMode = 2
  1284 + // #endif
  1285 + },
  1286 + /**
  1287 + * 提交订单
  1288 + * @return {Promise<void>}
  1289 + */
  1290 + async submitOrder() {
  1291 + if (!this.handleCheckOrderForm()) return;
  1292 + // 处理表单
  1293 + const data = this.handlePackageData()
  1294 + uni.showLoading({
  1295 + mask: true,
  1296 + title: '结算中...',
  1297 + })
  1298 + console.error(JSON.stringify(data))
  1299 + return
  1300 + try {
  1301 + console.log('结算中结算中结算中结算中结算中结算中',data)
  1302 + const res = await NET.request(API.PlaceOrder, data, 'POST')
  1303 + // 下单成功处理埋点
  1304 + this.$store.dispatch('doPointer', {
  1305 + eventType: 3,
  1306 + productIds: this.pointProductIds
  1307 + })
  1308 + if (this.type == 2) {
  1309 + let carSkusData = data.shops
  1310 + let dataList = uni.getStorageSync('dataList')
  1311 + let ids = []
  1312 + for (const shopObj of dataList) {
  1313 + ids = [...ids, ...shopObj.skus.filter(sku => (sku.selected === 1 || sku.selected === true)).map(sku => sku.skuId)]
  1314 + }
  1315 + await NET.request(API.DeleteCart, {ids}, 'POST')
  1316 + let skusArr = []
  1317 + for (let i = 0; i < carSkusData.length; i++) {
  1318 + carSkusData[i].skus.map(item => {
  1319 + skusArr.push(item.skuId)
  1320 + })
  1321 + }
  1322 + }
  1323 + let submitResult = res.data
  1324 + this.orderId = res.data.orderId
  1325 + submitResult.type = 1
  1326 + submitResult.paymentMode = data.paymentMode
  1327 + if(this.payObj.paymentMode && this.payObj.huabeiPeriod){
  1328 + submitResult.huabeiPeriod = this.payObj.huabeiPeriod
  1329 + }
  1330 + await handleDoPay.call(this, submitResult)
  1331 +
  1332 + } catch (e) {
  1333 + this.oneClickSubmit = true
  1334 + uni.showToast({
  1335 + title: '订单结算错误',
  1336 + icon: 'none'
  1337 + })
  1338 + } finally {
  1339 + uni.hideLoading()
  1340 + }
  1341 + }
  1342 +
  1343 + }
  1344 +}
  1345 +</script>
  1346 +
  1347 +<style lang="scss">
  1348 +page {
  1349 + background-color: #F7F7F7;
  1350 +}
  1351 +
  1352 +.content {
  1353 + padding: 0 30upx 198upx;
  1354 + box-sizing: border-box;
  1355 +}
  1356 +
  1357 +.address-box {
  1358 + margin-top: 20upx;
  1359 + background: #fff;
  1360 + border-radius: 10upx;
  1361 + width: 100%;
  1362 + padding: 30upx;
  1363 + box-sizing: border-box;
  1364 + display: flex;
  1365 + flex-direction: row;
  1366 + align-items: center;
  1367 + margin-bottom: 20rpx;
  1368 +}
  1369 +
  1370 +.address-box .address-img {
  1371 + width: 71upx;
  1372 + height: 57upx;
  1373 + margin-right: 20upx;
  1374 +}
  1375 +
  1376 +.address-box .address-r {
  1377 + flex: 1;
  1378 + display: flex;
  1379 + flex-direction: column;
  1380 + font-size: 28upx;
  1381 + color: #333;
  1382 +}
  1383 +
  1384 +.arrow-right-img {
  1385 + width: 62upx;
  1386 + height: 62upx;
  1387 + margin-left: 20upx;
  1388 +}
  1389 +
  1390 +.address-name-box {
  1391 + font-size: 30upx;
  1392 + color: #333;
  1393 +}
  1394 +
  1395 +.phone {
  1396 + font-size: 24upx;
  1397 + color: #999;
  1398 + margin-left: 20upx;
  1399 +}
  1400 +
  1401 +.address-info {
  1402 + font-size: 28upx;
  1403 + color: #333;
  1404 + margin-top: 15upx;
  1405 +}
  1406 +
  1407 +.order-list-box .item {
  1408 + background: #fff;
  1409 + border-radius: 10upx;
  1410 +}
  1411 +
  1412 +.order-list-top {
  1413 + height: 96upx;
  1414 + padding: 0 30upx;
  1415 + box-sizing: border-box;
  1416 + display: flex;
  1417 + flex-direction: row;
  1418 + align-items: center;
  1419 + justify-content: space-between;
  1420 + border-bottom: 2rpx solid #eee;
  1421 +}
  1422 +
  1423 +.top-l {
  1424 + display: flex;
  1425 + flex-direction: row;
  1426 + align-items: center;
  1427 +}
  1428 +
  1429 +.shop-img {
  1430 + width: 34upx;
  1431 + height: 34upx;
  1432 + margin-right: 10upx;
  1433 +}
  1434 +
  1435 +.shop-name {
  1436 + font-size: 30upx;
  1437 + color: #333;
  1438 + font-weight: bold;
  1439 +}
  1440 +
  1441 +.arrow-img {
  1442 + margin-left: 15upx;
  1443 + width: 62upx;
  1444 + height: 62upx;
  1445 +}
  1446 +
  1447 +.order-info-box {
  1448 + padding: 0 30upx;
  1449 + box-sizing: border-box;
  1450 +}
  1451 +
  1452 +.order-info-item {
  1453 + display: flex;
  1454 + flex-direction: row;
  1455 + padding: 20upx 0;
  1456 +}
  1457 +
  1458 +.product-img {
  1459 + width: 180upx;
  1460 + height: 180upx;
  1461 + border-radius: 10upx;
  1462 + margin-right: 30upx;
  1463 +}
  1464 +
  1465 +.info-box {
  1466 + flex: 1;
  1467 +}
  1468 +
  1469 +.product-name {
  1470 + font-size: 26upx;
  1471 + color: #333;
  1472 + height: 68upx;
  1473 + line-height: 34upx;
  1474 + display: -webkit-box;
  1475 + overflow: hidden;
  1476 + text-overflow: ellipsis;
  1477 + word-break: break-all;
  1478 + -webkit-box-orient: vertical;
  1479 + -webkit-line-clamp: 2;
  1480 +}
  1481 +
  1482 +.price-sku-box {
  1483 + width: 100%;
  1484 + display: flex;
  1485 + flex-direction: row;
  1486 + justify-content: space-between;
  1487 +}
  1488 +
  1489 +.product-sku {
  1490 + font-size: 24upx;
  1491 + font-weight: 500;
  1492 + color: #999;
  1493 + margin-left: -20upx;
  1494 + width: 100%;
  1495 + display: flex;
  1496 + flex-direction: row;
  1497 +}
  1498 +
  1499 +.product-price {
  1500 + font-size: 32upx;
  1501 + color: #C83732;
  1502 + font-weight: 400;
  1503 +}
  1504 +
  1505 +.product-price .fuhao {
  1506 + font-size: 28upx;
  1507 +}
  1508 +
  1509 +.product-num {
  1510 + font-size: 28upx;
  1511 + color: #999;
  1512 + font-weight: 400;
  1513 +}
  1514 +
  1515 +.adressTips {
  1516 + margin-bottom: 19rpx;
  1517 + color: #D53912;
  1518 +}
  1519 +
  1520 +.delivery-way-box {
  1521 + display: flex;
  1522 + flex-direction: column;
  1523 + border: 2rpx solid #E4E5E6;
  1524 + padding: 20rpx;
  1525 + margin-bottom: 20rpx;
  1526 + box-sizing: content-box;
  1527 +}
  1528 +
  1529 +.delivery-way-box .item {
  1530 + display: flex;
  1531 + flex-direction: row;
  1532 + align-items: center;
  1533 + justify-content: space-between;
  1534 + font-size: 26upx;
  1535 + color: #333;
  1536 +}
  1537 +
  1538 +.delivery-way-box .item {
  1539 + display: flex;
  1540 + flex-direction: row;
  1541 + align-items: center;
  1542 + justify-content: space-between;
  1543 + font-size: 26rpx;
  1544 + color: #333;
  1545 +}
  1546 +
  1547 +.delivery-way-box .item .way {
  1548 + color: #999;
  1549 + margin-left: 30upx;
  1550 +}
  1551 +
  1552 +.order-total-box {
  1553 + padding: 20upx 0;
  1554 + text-align: right;
  1555 +}
  1556 +
  1557 +.total-num {
  1558 + font-size: 26upx;
  1559 + color: #333;
  1560 +}
  1561 +
  1562 +.total-price {
  1563 + font-size: 46rpx;
  1564 + color: #333333;
  1565 +}
  1566 +
  1567 +.ml10 {
  1568 + margin-left: 10upx;
  1569 +}
  1570 +
  1571 +.order-flow-box {
  1572 + display: flex;
  1573 + flex-direction: column;
  1574 +}
  1575 +
  1576 +.flow-word {
  1577 + font-size: 24upx;
  1578 + color: #999;
  1579 + display: flex;
  1580 + flex-direction: column;
  1581 +}
  1582 +
  1583 +.mt25 {
  1584 + margin-top: 20upx;
  1585 +}
  1586 +
  1587 +.mt50 {
  1588 + margin-top: 30upx;
  1589 + margin-bottom: 20upx;
  1590 +}
  1591 +
  1592 +.order-confirm-box {
  1593 + position: fixed;
  1594 + bottom: 0;
  1595 + left: 0;
  1596 + width: 100%;
  1597 + background: #fff;
  1598 + padding: 30upx;
  1599 +}
  1600 +
  1601 +.num-box {
  1602 + font-size: 30upx;
  1603 + color: #999;
  1604 +}
  1605 +
  1606 +.num-box .total {
  1607 + color: #333;
  1608 +}
  1609 +
  1610 +.num-box .price {
  1611 + color: #ff7911;
  1612 + font-weight: bold;
  1613 +}
  1614 +
  1615 +.order-confirm-box .btn {
  1616 + width: 100%;
  1617 + height: 80rpx;
  1618 + line-height: 80rpx;
  1619 + background: #eee;
  1620 + font-size: 28rpx;
  1621 + color: #FFEBC4;
  1622 + text-align: center;
  1623 + margin-top: 20rpx;
  1624 +}
  1625 +
  1626 +.order-confirm-box .btn.active {
  1627 + background: #333333;
  1628 + color: #FFEBC4;
  1629 +}
  1630 +
  1631 +.order-confirm-box .btn.unActive {
  1632 + background: #333333;
  1633 + color: #FFEBC4;
  1634 + opacity: 0.7;
  1635 +}
  1636 +
  1637 +.discount-item1 {
  1638 + width: 100%;
  1639 + box-sizing: border-box;
  1640 + display: flex;
  1641 + flex-direction: row;
  1642 + align-items: center;
  1643 + justify-content: space-between;
  1644 + background: white;
  1645 + padding: 20rpx;
  1646 + border: 2rpx solid #E4E5E6;
  1647 +}
  1648 +
  1649 +.discount-item {
  1650 + width: 100%;
  1651 + height: 98upx;
  1652 + box-sizing: border-box;
  1653 + margin: 30upx 0;
  1654 + display: flex;
  1655 + flex-direction: row;
  1656 + align-items: center;
  1657 + justify-content: space-between;
  1658 + padding: 0 20upx;
  1659 + background: white;
  1660 +}
  1661 +
  1662 +.pay-type-item {
  1663 + .pay-type-radio {
  1664 + background-color: white;
  1665 + border-bottom: 1upx solid #EDEDED;
  1666 + margin-bottom: 20upx;
  1667 + padding: 24upx 20upx 24upx 20upx;
  1668 +
  1669 + .pay-type-img {
  1670 + display: inline-block;
  1671 +
  1672 + .pay-type-img-inner {
  1673 + width: 50upx;
  1674 + height: 50upx;
  1675 + vertical-align: middle;
  1676 + }
  1677 + }
  1678 +
  1679 + .pay-type-label {
  1680 + vertical-align: middle;
  1681 + margin-left: 30upx;
  1682 + }
  1683 +
  1684 + .pay-type-radio-item {
  1685 + float: right;
  1686 + width: 50upx;
  1687 + height: 50upx;
  1688 + }
  1689 +
  1690 + .huabei-detail {
  1691 + margin-top: 20upx;
  1692 +
  1693 + .fenqi-wenzi {
  1694 + display: inline-block;
  1695 + margin-left: 64upx;
  1696 + }
  1697 +
  1698 + .fenqi-amount {
  1699 + display: block;
  1700 + margin-left: 64upx;
  1701 + margin-top: 14upx;
  1702 + color: #BABBBC;
  1703 + }
  1704 +
  1705 + .fenqi-charge-fee {
  1706 + float: right;
  1707 + margin-right: 68upx;
  1708 + color: #BABBBC;
  1709 + }
  1710 +
  1711 + .fenqi-modal {
  1712 + width: 40upx;
  1713 + height: 40upx;
  1714 + margin-left: 20upx;
  1715 + float: right;
  1716 + position: relative;
  1717 + top: -80upx;
  1718 + }
  1719 + }
  1720 + }
  1721 +}
  1722 +
  1723 +.period-radio {
  1724 + margin: 30upx;
  1725 + width: 95%;
  1726 + border-bottom: 1px solid #EFEFEF;
  1727 +
  1728 + .period-amount {
  1729 + display: inline-block;
  1730 +
  1731 + .period-each-charge {
  1732 + display: inline-block;
  1733 + margin-top: 12upx;
  1734 + margin-left: 6upx;
  1735 + font-size: 26upx;
  1736 + color: #b7b7b7;
  1737 + margin-bottom: 13upx;
  1738 + }
  1739 + }
  1740 +
  1741 + .period-each {
  1742 + display: block;
  1743 + }
  1744 +
  1745 + .period-type-radio-item {
  1746 + float: right;
  1747 + }
  1748 +}
  1749 +
  1750 +.huabei-confirm {
  1751 + height: 120upx;
  1752 + padding: 0upx 108upx 0upx 32upx;
  1753 +
  1754 + .fenqi-all {
  1755 + display: inline-block;
  1756 + width: 100%;
  1757 + }
  1758 +
  1759 + .fenqi-total-amount {
  1760 + float: left;
  1761 + }
  1762 +
  1763 + .fenqi-confirm {
  1764 + float: right;
  1765 + width: 160upx;
  1766 + padding: 0upx 20upx;
  1767 +
  1768 + .btn {
  1769 + width: 216upx;
  1770 + height: 80upx;
  1771 + line-height: 80upx;
  1772 + border-radius: 40upx;
  1773 + font-size: 28upx;
  1774 + text-align: center;
  1775 + background: linear-gradient(90deg, rgba(255, 162, 0, 1), rgba(255, 121, 17, 1));
  1776 + color: #fff;
  1777 + display: inline-block;
  1778 + margin-right: 66upx;
  1779 + }
  1780 + }
  1781 +}
  1782 +
  1783 +.discount-info-box {
  1784 + display: flex;
  1785 + flex-direction: row;
  1786 +}
  1787 +
  1788 +.discount-label,
  1789 +.discount-info1 {
  1790 + font-size: 26upx;
  1791 + color: #333;
  1792 +}
  1793 +
  1794 +.discount-info2 {
  1795 + color: #C5AA7B;
  1796 +}
  1797 +
  1798 +.discount-img {
  1799 + width: 30upx;
  1800 + height: 30upx;
  1801 + margin-left: 20upx;
  1802 +}
  1803 +
  1804 +.activity-con {
  1805 + .activity-box {
  1806 + display: flex;
  1807 + flex-direction: column;
  1808 + width: 100%;
  1809 + height: 1000upx;
  1810 + }
  1811 +
  1812 +}
  1813 +
  1814 +.activity-box .title-box {
  1815 + width: 100%;
  1816 + height: 100upx;
  1817 + display: flex;
  1818 + flex-direction: row;
  1819 + align-items: center;
  1820 + justify-content: center;
  1821 + position: relative;
  1822 + border-bottom: solid 1px #EEEEEE;
  1823 +}
  1824 +
  1825 +.activity-coupon-box {
  1826 + display: flex;
  1827 + flex-direction: column;
  1828 + width: 100%;
  1829 + overflow: auto;
  1830 + flex: 1;
  1831 +}
  1832 +
  1833 +.title-box .close-btn {
  1834 + width: 100upx;
  1835 + height: 100upx;
  1836 + box-sizing: border-box;
  1837 + padding: 30upx;
  1838 + position: absolute;
  1839 + top: 0;
  1840 + right: 0;
  1841 +}
  1842 +
  1843 +.content-box {
  1844 + width: 100%;
  1845 + box-sizing: border-box;
  1846 + display: flex;
  1847 + flex-direction: column;
  1848 + padding: 30upx;
  1849 +}
  1850 +
  1851 +.tag-box {
  1852 + width: 100%;
  1853 + box-sizing: border-box;
  1854 + height: 80upx;
  1855 + line-height: 80upx;
  1856 + font-size: 28upx;
  1857 + font-weight: 500;
  1858 + color: #FF7911;
  1859 +}
  1860 +
  1861 +.label-lingqu {
  1862 + width: 100%;
  1863 + font-size: 28upx;
  1864 + font-weight: 500;
  1865 + color: rgba(51, 51, 51, 1);
  1866 +}
  1867 +
  1868 +.coupon-item1 {
  1869 + width: 690upx;
  1870 + height: 120upx;
  1871 + margin-top: 20upx;
  1872 + color: #FFFFFF;
  1873 + flex-shrink: 0;
  1874 +}
  1875 +
  1876 +.coupon-item2 {
  1877 + width: 690upx;
  1878 + height: 120upx;
  1879 + background-size: 690upx 120upx;
  1880 + margin-top: 20upx;
  1881 + color: rgba(255, 121, 17, 1);
  1882 + flex-shrink: 0
  1883 +}
  1884 +
  1885 +.un-coupon-item {
  1886 + color: #bbb;
  1887 +}
  1888 +
  1889 +.money-box {
  1890 + font-size: 40upx;
  1891 + font-weight: 500;
  1892 +
  1893 +}
  1894 +
  1895 +.info-box {
  1896 + font-size: 24upx;
  1897 + font-weight: 400;
  1898 + margin: 10rpx;
  1899 +}
  1900 +
  1901 +
  1902 +.receive-success {
  1903 + width: 100%;
  1904 + position: fixed;
  1905 + top: 0;
  1906 + bottom: 0;
  1907 + left: 0;
  1908 + display: flex;
  1909 + flex-direction: column;
  1910 + align-items: center;
  1911 + justify-content: center;
  1912 + z-index: 9999;
  1913 +}
  1914 +
  1915 +.success-box {
  1916 + width: 380upx;
  1917 + height: 280upx;
  1918 + background: rgba(0, 0, 0, 0.5);
  1919 + border-radius: 10upx;
  1920 + display: flex;
  1921 + flex-direction: column;
  1922 + align-items: center;
  1923 + justify-content: center;
  1924 +}
  1925 +
  1926 +.success-box .success-img {
  1927 + width: 200upx;
  1928 + height: 130upx;
  1929 +}
  1930 +
  1931 +.success-box .text {
  1932 + font-size: 28upx;
  1933 + margin-top: 50upx;
  1934 + font-weight: 400;
  1935 + color: rgba(255, 255, 255, 1);
  1936 +}
  1937 +
  1938 +.check-img {
  1939 + width: 40upx;
  1940 + height: 40upx;
  1941 + margin-top: 40rpx;
  1942 +}
  1943 +
  1944 +.mt30 {
  1945 + margin-top: 30upx;
  1946 +}
  1947 +
  1948 +.activity-con {
  1949 + .activity-box {
  1950 + display: flex;
  1951 + flex-direction: column;
  1952 + width: 100%;
  1953 + height: 1000upx;
  1954 + }
  1955 +
  1956 +}
  1957 +
  1958 +.activity-box .title-box {
  1959 + width: 100%;
  1960 + height: 100upx;
  1961 + display: flex;
  1962 + flex-direction: row;
  1963 + align-items: center;
  1964 + justify-content: center;
  1965 + position: relative;
  1966 + border-bottom: solid 1px #EEEEEE;
  1967 +}
  1968 +
  1969 +.activity-coupon-box {
  1970 + display: flex;
  1971 + flex-direction: column;
  1972 + width: 100%;
  1973 + overflow: auto;
  1974 + flex: 1;
  1975 +}
  1976 +
  1977 +.title-box .close-btn {
  1978 + width: 100upx;
  1979 + height: 100upx;
  1980 + box-sizing: border-box;
  1981 + padding: 30upx;
  1982 + position: absolute;
  1983 + top: 0;
  1984 + right: 0;
  1985 +}
  1986 +
  1987 +.content-box {
  1988 + width: 100%;
  1989 + box-sizing: border-box;
  1990 + display: flex;
  1991 + flex-direction: column;
  1992 + padding: 30upx;
  1993 +}
  1994 +
  1995 +.tag-box {
  1996 + width: 100%;
  1997 + box-sizing: border-box;
  1998 + height: 80upx;
  1999 + line-height: 80upx;
  2000 + font-size: 28upx;
  2001 + font-weight: 500;
  2002 + color: #FF7911;
  2003 +}
  2004 +
  2005 +.label-lingqu {
  2006 + width: 100%;
  2007 + font-size: 28upx;
  2008 + font-weight: 500;
  2009 + color: rgba(51, 51, 51, 1);
  2010 +}
  2011 +
  2012 +.couponBox {
  2013 + display: flex;
  2014 + flex-flow: wrap;
  2015 + margin-top: 30rpx;
  2016 + justify-content: space-between;
  2017 +}
  2018 +
  2019 +.coupon-item {
  2020 + width: 48%;
  2021 + height: 291rpx;
  2022 + background: url("https://jy.scjysm.asia:18086/mefile/file/static/images/couponsIcon.png") no-repeat center top;
  2023 + margin-top: 20upx;
  2024 + color: #C5AA7B;
  2025 + flex-shrink: 0;
  2026 + text-align: center;
  2027 + padding-top: 1rpx;
  2028 + background-size: contain;
  2029 +}
  2030 +
  2031 +.un-coupon-item {
  2032 + color: #bbb;
  2033 +}
  2034 +
  2035 +.money-box {
  2036 + font-size: 40upx;
  2037 + font-weight: 500;
  2038 + margin-top: 30rpx;
  2039 +}
  2040 +
  2041 +.integralPayBox {
  2042 + margin: 20rpx 0;
  2043 +
  2044 + .integralBg {
  2045 + height: 98rpx;
  2046 + display: flex;
  2047 + justify-content: space-between;
  2048 + align-items: center;
  2049 + background: #FFFFFF;
  2050 + padding: 0 20rpx;
  2051 +
  2052 + .maxDeduction {
  2053 + margin-right: 15rpx;
  2054 + }
  2055 + }
  2056 +}
  2057 +</style>
  2058 +<style>
  2059 +.pay-type-item /deep/ .uni-radio-input-checked {
  2060 + background-color: #C5AA7B !important;
  2061 + border-color: #C5AA7B !important;
  2062 +}
  2063 +
  2064 +.maxIntegral /deep/ .uni-checkbox-input {
  2065 + width: 30rpx;
  2066 + height: 30rpx;
  2067 +}
  2068 +
  2069 +.maxIntegral /deep/ .uni-checkbox-input-checked:before {
  2070 + font-size: 30rpx;
  2071 +}
  2072 +
  2073 +.maxIntegral /deep/ .uni-checkbox-input-checked {
  2074 + border: 2rpx solid #C5AA7B !important;
  2075 +}
  2076 +</style>
... ...
ceres-uniapp-master/pages_category_page1/orderModule/orderDetails.vue
... ... @@ -454,6 +454,7 @@
454 454 this.getDataList(this.orderId)
455 455 this.Orderrefund()
456 456 this.getHuabeiFeeRateList()
  457 +
457 458 },
458 459 onUnload() {
459 460 if (this.timeOut) {
... ... @@ -614,6 +615,14 @@
614 615 if (this.dataList.state == 1 || this.dataList.state == 6) {
615 616 this.countDown();
616 617 }
  618 + NET.request(API.cereCouponKeyUse, {
  619 + orderId: orderId,
  620 + usedMerchantId: this.dataList.shopId
  621 + }, 'GET').then(res1 => {
  622 + console.error(res1)
  623 + }).catch(res => {
  624 + // uni.hideLoading()
  625 + })
617 626 }).catch(res => {
618 627 // uni.hideLoading()
619 628 })
... ...
ceres-uniapp-master/pages_category_page1/store/index.vue
... ... @@ -53,11 +53,11 @@
53 53 <image src="https://jy.scjysm.asia:18086/mefile/file/static/images/arrowRight.png"></image>
54 54 </view>
55 55 </view>
56   - <scroll-view style="white-space: nowrap;width: 100%;" scroll-x="true">
57   - <view style="display: inline-block;" v-for="item of 10" @click="couponshow = true">
58   - <view class="couponItem u-skeleton-fillet flex-items" style="margin-right: 20rpx;width: 130rpx;" >
  56 + <!-- <scroll-view style="white-space: nowrap;width: 100%;" scroll-x="true">
  57 + <view style="display: inline-block;" v-for="item of conlist" @click="couponshow = true">
  58 + <view class="couponItem u-skeleton-fillet flex-items" style="margin-right: 20rpx;" >
59 59 <view style="color: #FFEBC4;font-size: 22rpx;">
60   - 3折
  60 + {{item.couponType=='1'?'¥'+item.discountContent:item.discountContent+'折'}}
61 61 </view>
62 62 <view style=" border-right: 2rpx dashed #fff;height: 20rpx;margin: 0 10rpx;"></view>
63 63 <view style="color: #fff;font-size: 22rpx;">
... ... @@ -66,7 +66,7 @@
66 66 </view>
67 67 </view>
68 68  
69   - </scroll-view>
  69 + </scroll-view> -->
70 70 </view>
71 71 <view class="shopContent">
72 72 <view class="tabs-nav-warp">
... ... @@ -180,22 +180,22 @@
180 180 <view style="background: #f3f3f3;">
181 181 <view style="text-align: center;padding: 30rpx 0;">免费领</view>
182 182 <view style="height: 500rpx;overflow-y: scroll;padding: 0 30rpx;">
183   - <view v-for="(item,index) in 5" style="display: flex;align-items: center;justify-content: space-between;padding:10rpx 20rpx;background: #fff;margin-bottom: 25rpx;border-radius: 18rpx;">
  183 + <view v-for="(item,index) in conlist" style="display: flex;align-items: center;justify-content: space-between;padding:10rpx 20rpx;background: #fff;margin-bottom: 25rpx;border-radius: 18rpx;">
184 184 <view style="display: flex;">
185 185 <view>
186 186 <image :src="storeInfo.shopLogo" style="width: 100rpx;height: 100rpx;"></image>
187 187 </view>
188 188 <view style="height: 100rpx;display: flex;flex-direction: column;justify-content: space-around;margin-left: 10rpx;">
189 189 <view style="font-size: 26rpx;">
190   - <span style="color: red;margin-right: 5rpx;">¥2</span>
191   - 代金券
  190 + <span style="color: red;margin-right: 5rpx;">{{item.couponType=='1'?'¥'+item.discountContent:item.discountContent+'折'}}</span>
  191 + {{item.couponType=='1'?'满减券':'折扣券'}}
192 192 </view>
193 193 <view style="font-size: 22rpx;color: #909090;">
194   - 有效期2024.12.1
  194 + 有效期:{{item.endTime}}
195 195 </view>
196 196 </view>
197 197 </view>
198   - <view style="color: red;font-size: 26rpx;">领取</view>
  198 + <view style="color: red;font-size: 26rpx;" @click="getconlist(item)">领取</view>
199 199 </view>
200 200  
201 201 </view>
... ... @@ -244,6 +244,7 @@
244 244 topHeight: 10,
245 245 hasService: false,
246 246 isLoading: false,
  247 + conlist:[]
247 248 }
248 249 },
249 250 components: {
... ... @@ -278,6 +279,11 @@
278 279 // #ifdef MP-WEIXIN
279 280 this.getServiceUrl(this.id)
280 281 // #endif
  282 + // this.id
  283 + // NET.request(API.cereCouponMainTablequeryByPage, {pageNumber:0,pageSize:20,shopId:this.id}, 'POST').then(res => {
  284 + // console.error(res)
  285 + // this.conlist = res.data.content
  286 + // })
281 287 },
282 288 onReachBottom() {
283 289 if (this.loadingType == 1) {
... ... @@ -288,6 +294,12 @@
288 294 }
289 295 },
290 296 methods: {
  297 + getconlist(e) {
  298 + console.error(e)
  299 + NET.request(API.receiveCoupons, {"couponId":e.id,"userId":uni.getStorageSync('storage_key').buyerUserId}, 'GET').then(res => {
  300 + console.log(res)
  301 + })
  302 + },
291 303 // 读取画布
292 304 canvasGet() {
293 305 var _this = this
... ...
merchant-web-master/src/layout/components/AppMain.vue
... ... @@ -20,14 +20,15 @@ export default {
20 20 <style scoped>
21 21 .app-main {
22 22 /*50 = navbar */
23   - min-height: calc(100vh - 50px);
  23 + /* min-height: calc(100vh - 50px); */
24 24 width: 100%;
25 25 position: relative;
26 26 overflow: hidden;
27   - background: #f7f7f7;
  27 +
  28 + /* height: 100%; */
28 29 }
29 30 .fixed-header + .app-main {
30   - padding-top: 50px;
  31 + /* padding-top: 50px; */
31 32 }
32 33 </style>
33 34  
... ...
merchant-web-master/src/layout/index.vue
... ... @@ -338,7 +338,13 @@ export default {
338 338 margin-top: 50px;
339 339 }
340 340 .main-container{
341   - margin-top: 50px;
  341 + // margin-top: 50px;
  342 + position: fixed;
  343 + right: 0;
  344 + top: 50px;
  345 + height: calc(100vh - 50px);
  346 + background: #f7f7f7;
  347 + // height: calc(100vh -50px);
342 348 }
343 349 .topList{
344 350 position: relative;
... ...
merchant-web-master/src/views/couponmanagement/allinfo.vue 0 → 100644
  1 +<template>
  2 + <div>
  3 + <!-- 根据 type 的值决定显示哪个组件 -->
  4 + <capitalpoolinfo ref="capitalpoolinforef" v-if="type == '1'" @changecouponid="changecouponid"/>
  5 + <couponinfo ref="couponinforef" v-else-if="type == '2'" @changecouponid="changecouponid"/>
  6 + </div>
  7 +</template>
  8 +
  9 +<script>
  10 +import capitalpoolinfo from './capitalpoolinfo.vue';
  11 +import couponinfo from './couponinfo.vue';
  12 +
  13 +export default {
  14 + components: {
  15 + capitalpoolinfo,
  16 + couponinfo
  17 + },
  18 + props: {
  19 + type: {
  20 + type: String,
  21 + required: '1'
  22 + },
  23 + },
  24 + data() {
  25 + return {
  26 + id: ''
  27 + }
  28 + },
  29 + methods: {
  30 + int(e) {
  31 + if(this.type === '1'){
  32 + this.$refs.capitalpoolinforef.int(e)
  33 + }else{
  34 + this.$refs.couponinforef.int(e)
  35 + }
  36 + },
  37 + chanetype(e) {
  38 + this.type = e
  39 + },
  40 + changecouponid(e) {
  41 + console.error(e)
  42 + this.$emit('changetypeinfo','2')
  43 + // this.$refs.couponinforef.int(e)
  44 + },
  45 + changecapitalpoolid(e) {
  46 +
  47 + },
  48 + },
  49 +};
  50 +</script>
  51 +
  52 +<style scoped>
  53 +/* 添加样式 */
  54 +</style>
0 55 \ No newline at end of file
... ...
merchant-web-master/src/views/couponmanagement/coupon.vue
... ... @@ -19,13 +19,14 @@
19 19 订单满 <el-input-number v-model="couponfrom.maxDiscountAmount" :controls="false" :min="0" :precision="2" :step="0.01" /> 元 减 <el-input-number v-model="couponfrom.discountContent" :controls="false" :min="0" :precision="2" :step="0.01" /> 元
20 20 </el-form-item>
21 21 <el-form-item v-else class="inputW discount" label="优惠内容" prop="discountContent">
  22 +
  23 + 打 <el-input-number v-model="couponfrom.discountContent" :controls="false" :min="0" :max="9.9" :precision="1" :step="0.1" /> 折
22 24 <span v-if="couponfrom.couponType === '2'" style="margin-right: 10px;">
23 25 最高优惠金额
24 26 <el-input-number v-model="couponfrom.maxDiscountAmount" :controls="false" :min="0" :precision="2" :step="0.01" /> 元
25 27 </span>
26   - 打 <el-input-number v-model="couponfrom.discountContent" :controls="false" :min="0" :max="9.9" :precision="1" :step="0.1" /> 折
27   - <label>输入值要大于0 小于10,可保留一位小数</label>
28   -
  28 + <label>折数输入值要大于0 小于10,可保留一位小数</label>
  29 +
29 30 </el-form-item>
30 31 <!-- <el-form-item v-if="couponfrom.couponType === '2'" class="inputW" label="最高优惠金额" prop="maxDiscountAmount">
31 32 <el-input-number v-model="couponfrom.maxDiscountAmount" :controls="false" :min="0" :precision="2" :step="0.01" /> 元
... ... @@ -80,6 +81,12 @@
80 81 <el-input v-model="couponfrom.pointsRequired" type="number" style="width: 150px" /> 分
81 82 </el-form-item>
82 83 </div>
  84 + <el-form-item label="是否重复领用:">
  85 + <el-radio-group v-model="couponfrom.receiveAgain">
  86 + <el-radio :label="1" >是</el-radio>
  87 + <el-radio :label="0" >否</el-radio>
  88 + </el-radio-group>
  89 + </el-form-item>
83 90 <el-form-item class="timeDataBox" label="用券时间" prop="startTime">
84 91 <el-date-picker
85 92 v-model="dateInfo"
... ... @@ -92,7 +99,8 @@
92 99 />
93 100 </el-form-item>
94 101 <el-form-item class="boxWidth" label="数量" prop="totalCoupons">
95   - <el-input v-model="couponfrom.totalCoupons" type="number" oninput="value=value.replace(/[^\d]/g,'')" />张 <span v-if="coupoobj.symon && changecouponfrom()!=0">(最大:{{ (coupoobj.symon/changecouponfrom()).toFixed(0) }} 张)</span>
  102 + <el-input-number v-model="couponfrom.totalCoupons" :controls="false" :min="1" :precision="0" :step="1" /> 张 <span v-if="coupoobj.symon && changecouponfrom()!=0">(最大:{{ (coupoobj.symon/changecouponfrom()).toFixed(0) }} 张)</span>
  103 + <!-- <el-input v-model="couponfrom.totalCoupons" :controls="false" type="number" :min="1" oninput="value=value.replace(/[^\d]/g,'')" />张 <span v-if="coupoobj.symon && changecouponfrom()!=0">(最大:{{ (coupoobj.symon/changecouponfrom()).toFixed(0) }} 张)</span> -->
96 104 </el-form-item>
97 105 <el-form-item label="备注">
98 106 <el-input maxlength="200" show-word-limit rows="4" v-model="couponfrom.remark" placeholder="请输入备注" type="textarea" />
... ...
merchant-web-master/src/views/couponmanagement/couponinfo.vue
1 1 <template>
2   - <div style="background-color:#f7f7f7;padding:10px 10px;">
3   - <div class="couponPage" >
4   - <div>
5   - <div style="height:58px;line-height:58px;">
6   - <div style="color:#0006"> <span>优惠券管理</span> <span style="padding:0 5px;">></span> <span>优惠券列表</span> <span style="padding:0 5px;">></span><span style="color:#000000e6">详情</span></div>
  2 + <div>
  3 + <div style="display: flex;margin-bottom: 10px;">
  4 + <div v-for="item in typelist" style="width: 30%;margin-right: 3%;text-align: center;padding: 20px 0;border-radius: 3px;border: 2px solid #eee;">
  5 + <div style="font-size: 14px;color: #a8abb2;">{{item.type}}</div>
  6 + <div style="font-size: 22px;margin-top: 10px;color: rgb(63, 155, 106);">{{item.num}}</div>
7 7 </div>
8   - <div style="display: flex;margin-bottom: 10px;">
9   - <div v-for="item in typelist" style="width: 30%;margin-right: 3%;text-align: center;padding: 20px 0;border-radius: 3px;border: 2px solid #eee;">
10   - <div style="font-size: 14px;color: #a8abb2;">{{item.type}}</div>
11   - <div style="font-size: 22px;margin-top: 10px;color: rgb(63, 155, 106);">{{item.num}}</div>
12   - </div>
13   - </div>
14   - <el-tabs v-model="activeName" @tab-click="handleClick">
15   - <el-tab-pane label="渠道领用" name="first">渠道领用</el-tab-pane>
16   - <el-tab-pane label="用户领取" name="second">用户领取</el-tab-pane>
17   - <el-tab-pane label="用户使用" name="third">用户使用</el-tab-pane>
18   - <el-tab-pane label="商家补贴" name="fourth">商家补贴</el-tab-pane>
19   - </el-tabs>
20   - <!-- 搜索 -->
21   - <div class="formSearch">
22   - <!-- 搜索条件 -->
23   - <el-form :inline="true" :model="query" class="demo-form-inline">
24   - <el-form-item label="名称">
25   - <el-input v-model="query.couponName" placeholder="请输入名称" />
26   - </el-form-item>
27   - </el-form>
28   - <div>
29   - <el-button style="background-color: #3F9B6A;color: #fff" @click="search">查询</el-button>
30   - <el-button class="buttonHover"
31   - style="color: #606266;border: 1px solid #dddfe5;background-color: #fff;" @click="clear">重置</el-button>
32   - </div>
  8 + </div>
  9 + <el-tabs v-model="activeName" @tab-click="handleClick">
  10 + <el-tab-pane label="渠道领用" name="first">渠道领用</el-tab-pane>
  11 + <el-tab-pane label="用户领取" name="second">用户领取</el-tab-pane>
  12 + <el-tab-pane label="用户使用" name="third">用户使用</el-tab-pane>
  13 + <el-tab-pane label="商家补贴" name="fourth">商家补贴</el-tab-pane>
  14 + </el-tabs>
  15 + <!-- 搜索 -->
  16 + <div class="formSearch">
  17 + <!-- 搜索条件 -->
  18 + <el-form :inline="true" :model="query" class="demo-form-inline">
  19 + <el-form-item label="名称">
  20 + <el-input v-model="query.couponName" placeholder="请输入名称" />
  21 + </el-form-item>
  22 + </el-form>
  23 + <div>
  24 + <el-button style="background-color: #3F9B6A;color: #fff" @click="search">查询</el-button>
  25 + <el-button class="buttonHover"
  26 + style="color: #606266;border: 1px solid #dddfe5;background-color: #fff;" @click="clear">重置</el-button>
33 27 </div>
34   - <!-- 表格 -->
35   - <div class="tableBox">
36   - <el-table
37   - ref="multipleTable"
38   - :data="tableData"
39   - :header-cell-style="{fontSize: '14px',color:'#0009',fontWeight: 'normal',backgroundColor:'#f5f8f9'}"
40   - tooltip-effect="light"
41   - >
42   - <el-table-column label="编号" >
43   - <template slot-scope="scope">{{ scope.row.id }}</template>
44   - </el-table-column>
45   - <el-table-column label="优惠券名称" >
46   - <template slot-scope="scope">{{ scope.row.couponName }}</template>
47   - </el-table-column>
48   - <el-table-column label="类型">
49   - <template slot-scope="scope">
50   - <span v-if="scope.row.couponType == '1'">满减券</span>
51   - <span v-else-if="scope.row.couponType == '2'">折扣券</span>
52   - </template>
53   - </el-table-column>
54   - <el-table-column label="优惠内容">
55   - <template slot-scope="scope">
56   - <span v-if="scope.row.couponType == '1'">满{{ scope.row.maxDiscountAmount }}减{{ scope.row.discountContent }}</span>
57   - <span v-else-if="scope.row.couponType == '2'">{{ scope.row.discountContent }}折 最高减{{ scope.row.maxDiscountAmount }}</span>
58   - </template>
59   - </el-table-column>
60   - <el-table-column label="操作" fixed="right">
61   - <template slot-scope="scope">
62   - <div class="btnList">
63   - <div class="tableBtn greens" @click="xq(scope.row)">查看详情</div>
64   - <!-- <div class="tableBtn greens" @click="addcoupon(scope.row)">生成优惠券</div> -->
65   - </div>
66   - </template>
67   - </el-table-column>
68   - </el-table>
69   - <div style="display: flex;justify-content: space-between;margin: 20px 0;">
70   - <div style="font-size: 14px;">共 <span style="color: #3F9B6A;">{{total}}</span> 项数据</div>
71   - <el-pagination
72   - :current-page="query.pageNumber"
73   - :page-sizes="[10, 20, 50, 100]"
74   - :page-size="10"
75   - background
76   - small
77   - layout="prev, pager, next"
78   - :total="total"
79   - @size-change="handleSizeChange"
80   - @current-change="handleCurrentChange">
81   - </el-pagination>
82   - </div>
83   - <div style="display: flex;">
84   - <router-link to="/other/capitalpoolinfo"> <el-button class="buttonHover" style="color: #606266;border: 1px solid #dddfe5;background-color: #fff;" >返回</el-button></router-link>
85   - </div>
  28 + </div>
  29 + <!-- 表格 -->
  30 + <div class="tableBox">
  31 + <el-table
  32 + ref="multipleTable"
  33 + :data="tableData"
  34 + :header-cell-style="{fontSize: '14px',color:'#0009',fontWeight: 'normal',backgroundColor:'#f5f8f9'}"
  35 + tooltip-effect="light"
  36 + >
  37 + <el-table-column label="编号" >
  38 + <template slot-scope="scope">{{ scope.row.id }}</template>
  39 + </el-table-column>
  40 + <el-table-column label="优惠券名称" >
  41 + <template slot-scope="scope">{{ scope.row.couponName }}</template>
  42 + </el-table-column>
  43 + <el-table-column label="类型">
  44 + <template slot-scope="scope">
  45 + <span v-if="scope.row.couponType == '1'">满减券</span>
  46 + <span v-else-if="scope.row.couponType == '2'">折扣券</span>
  47 + </template>
  48 + </el-table-column>
  49 + <el-table-column label="优惠内容">
  50 + <template slot-scope="scope">
  51 + <span v-if="scope.row.couponType == '1'">满{{ scope.row.maxDiscountAmount }}减{{ scope.row.discountContent }}</span>
  52 + <span v-else-if="scope.row.couponType == '2'">{{ scope.row.discountContent }}折 最高减{{ scope.row.maxDiscountAmount }}</span>
  53 + </template>
  54 + </el-table-column>
  55 + <el-table-column label="操作" fixed="right">
  56 + <template slot-scope="scope">
  57 + <div class="btnList">
  58 + <div class="tableBtn greens" @click="xq(scope.row)">查看详情</div>
  59 + <!-- <div class="tableBtn greens" @click="addcoupon(scope.row)">生成优惠券</div> -->
  60 + </div>
  61 + </template>
  62 + </el-table-column>
  63 + </el-table>
  64 + <div style="display: flex;justify-content: space-between;margin: 20px 0;">
  65 + <div style="font-size: 14px;">共 <span style="color: #3F9B6A;">{{total}}</span> 项数据</div>
  66 + <el-pagination
  67 + :current-page="query.pageNumber"
  68 + :page-sizes="[10, 20, 50, 100]"
  69 + :page-size="10"
  70 + background
  71 + small
  72 + layout="prev, pager, next"
  73 + :total="total"
  74 + @size-change="handleSizeChange"
  75 + @current-change="handleCurrentChange">
  76 + </el-pagination>
86 77 </div>
87 78 </div>
88   - </div>
89   -
90   - </div>
91   - </template>
  79 +
  80 + </div>
  81 +</template>
92 82  
93   - <script>
94   - import { myCoupons}from '@/api/couponmanagement/couponlist.js'
95   - import router from '@/router';
96   - import coupon from './coupon.vue';
  83 +<script>
  84 +import { myCoupons}from '@/api/couponmanagement/couponlist.js'
  85 +import router from '@/router';
  86 +import coupon from './coupon.vue';
97 87  
98   - export default {
  88 +export default {
99 89  
100   - components:{
101   - coupon
102   - },
103   - data () {
104   - return {
105   - activeName: 'second',
106   - typelist:[
107   - {
108   - num:100,
109   - type:'渠道领用',
110   - color:'#ff5e5e'
111   - },
112   - {
113   - num:100,
114   - type:'用户领取',
115   - color:'#ff883a'
116   - },
117   - {
118   - num:100,
119   - type:'用户使用',
120   - color:'#ffc461'
121   - },
122   - {
123   - num:100,
124   - type:'商家补贴',
125   - color:'#a467f0'
126   - },
127   - ],
128   - query: {
129   - activityName: '', // 活动名称
130   - // 活动状态 0-报名未开始 1-报名进行中 2-活动待开始 3-活动进行中 4-活动已结束
131   - state: '',
132   - pageNumber: 1,
133   - pageSize: 10
  90 + components:{
  91 + coupon
  92 + },
  93 + data () {
  94 + return {
  95 + activeName: 'second',
  96 + typelist:[
  97 + {
  98 + num:100,
  99 + type:'渠道领用',
  100 + color:'#ff5e5e'
134 101 },
135   - total: 0,
136   - tableData: [],
137   - }
  102 + {
  103 + num:100,
  104 + type:'用户领取',
  105 + color:'#ff883a'
  106 + },
  107 + {
  108 + num:100,
  109 + type:'用户使用',
  110 + color:'#ffc461'
  111 + },
  112 + {
  113 + num:100,
  114 + type:'商家补贴',
  115 + color:'#a467f0'
  116 + },
  117 + ],
  118 + query: {
  119 + activityName: '', // 活动名称
  120 + // 活动状态 0-报名未开始 1-报名进行中 2-活动待开始 3-活动进行中 4-活动已结束
  121 + state: '',
  122 + pageNumber: 1,
  123 + pageSize: 10
  124 + },
  125 + total: 0,
  126 + tableData: [],
  127 + }
  128 + },
  129 + created () {
  130 + // this.getAll()
  131 + },
  132 + methods: {
  133 + int(e) {
  134 + this.fundPoolId = e
  135 + // this.clear()
  136 + },
  137 + handleClick(tab, event) {
  138 + console.log(tab, event);
  139 + },
  140 + xq(e) {
  141 + // 跳转路由
  142 + // router.push({
  143 + // path: '/other/coupon',
  144 + // query: {
  145 + // id: e.id
  146 + // }
  147 + // })
  148 + console.error(e.id)
  149 + // this.$emit('changecapitalpoolid',e.id)
  150 + },
  151 + async getAll () {
  152 + const res = await myCoupons(this.query)
  153 + console.error(res.data.content)
  154 + this.tableData = res.data.content
  155 + this.total = res.data.numberOfElements
138 156 },
139   - created () {
  157 + handleSizeChange (val) {
  158 + this.query.pageSize = val
  159 + this.getAll()
  160 + },
  161 + handleCurrentChange (val) {
  162 + this.query.pageNumber = val
  163 + this.getAll()
  164 + },
  165 + search () {
  166 + this.total = 1
  167 + this.query.pageNumber = 1
  168 + this.getAll()
  169 + },
  170 + // 重置
  171 + clear () {
  172 + this.query = {
  173 + activityName: '',
  174 + state: '',
  175 + pageNumber: 1,
  176 + pageSize: 10
  177 + }
140 178 this.getAll()
141 179 },
142   - methods: {
143   - handleClick(tab, event) {
144   - console.log(tab, event);
145   - },
146   - xq(e) {
147   - // 跳转路由
148   - router.push({
149   - path: '/other/coupon',
150   - query: {
151   - id: e.id
152   - }
153   - })
154   - },
155   - async getAll () {
156   - const res = await myCoupons(this.query)
157   - console.error(res.data.content)
158   - this.tableData = res.data.content
159   - this.total = res.data.numberOfElements
160   - },
161   - handleSizeChange (val) {
162   - this.query.pageSize = val
163   - this.getAll()
164   - },
165   - handleCurrentChange (val) {
166   - this.query.pageNumber = val
167   - this.getAll()
168   - },
169   - search () {
170   - this.total = 1
171   - this.query.pageNumber = 1
172   - this.getAll()
173   - },
174   - // 重置
175   - clear () {
176   - this.query = {
177   - activityName: '',
178   - state: '',
179   - pageNumber: 1,
180   - pageSize: 10
181   - }
182   - this.getAll()
183   - },
184 180  
185   - }
186 181 }
187   - </script>
  182 +}
  183 +</script>
188 184  
189   - <style scoped lang="scss">
190   - ::v-deep .el-form-item {
191   - margin-bottom: 0;
  185 +<style scoped lang="scss">
  186 +::v-deep .el-form-item {
  187 + margin-bottom: 0;
  188 +}
  189 +::v-deep .el-tabs__content {
  190 + display: none;
  191 +}
  192 + ::v-deep .el-tabs__item{
  193 + font-size: 16px;
  194 + font-family: "Alibaba PuHuiTi 2.0-55 Regular";
192 195 }
193   - ::v-deep .el-tabs__content {
194   - display: none;
  196 + ::v-deep .el-dialog__header{
  197 + border-bottom: 2px solid #eee;
  198 + background-color: #fff;
195 199 }
196   - ::v-deep .el-tabs__item{
197   - font-size: 16px;
198   - font-family: "Alibaba PuHuiTi 2.0-55 Regular";
199   - }
200   - ::v-deep .el-dialog__header{
201   - border-bottom: 2px solid #eee;
202   - background-color: #fff;
203   - }
204   - ::v-deep .el-dialog__title {
205   - color: #303133;
206   - }
207   - .footer{
208   - font-size: 24px;
209   - .btn_list {
210   - display: flex;
211   - flex-direction: row-reverse;
212   - span {
213   - padding: 0;
214   - margin: 0;
215   - width: 100px;
216   - height:32px;
217   - line-height:32px;
218   - text-align: center;
219   - display: inline-block;
220   - font-size: 16px;
221   - border-radius: 4px;
222   - box-sizing: border-box;
223   - &:hover {
224   - cursor: pointer;
225   - }
226   - &:nth-child(1) {
227   - background: rgba(255, 255, 255, 1);
228   - order: 1px solid rgba(224, 229, 235, 1);
  200 + ::v-deep .el-dialog__title {
  201 + color: #303133;
  202 + }
  203 + .footer{
  204 + font-size: 24px;
  205 + .btn_list {
  206 + display: flex;
  207 + flex-direction: row-reverse;
  208 + span {
  209 + padding: 0;
  210 + margin: 0;
  211 + width: 100px;
  212 + height:32px;
  213 + line-height:32px;
  214 + text-align: center;
  215 + display: inline-block;
  216 + font-size: 16px;
  217 + border-radius: 4px;
  218 + box-sizing: border-box;
  219 + &:hover {
  220 + cursor: pointer;
  221 + }
  222 + &:nth-child(1) {
  223 + background: rgba(255, 255, 255, 1);
  224 + order: 1px solid rgba(224, 229, 235, 1);
229 225  
230   - border: 1px solid rgba(224, 229, 235, 1);
231   - }
232   - &:nth-child(2) {
233   - background: #3f9b6a;
234   - color: #fff;
235   - margin-right: 20px;
236   - }
  226 + border: 1px solid rgba(224, 229, 235, 1);
  227 + }
  228 + &:nth-child(2) {
  229 + background: #3f9b6a;
  230 + color: #fff;
  231 + margin-right: 20px;
237 232 }
238 233 }
239 234 }
240   - .couponPage{
  235 + }
  236 +.couponPage{
241 237  
242   - padding: 0 20px 20px 20px;
243   - min-height: calc(100vh - 50px - 20px);
244   - background-color: #Fff;
  238 + padding: 0 20px 20px 20px;
  239 + min-height: calc(100vh - 50px - 20px);
  240 + background-color: #Fff;
245 241  
246 242  
247   - .tableBox{
248   - text-align: center;
249   - .fenye{
250   - // margin: 20px;
251   - }
  243 + .tableBox{
  244 + text-align: center;
  245 + .fenye{
  246 + // margin: 20px;
252 247 }
253 248 }
254   - .couponDialogBox {
255   - max-height: 600px;
256   - overflow-y: auto;
257   - }
258   - .formSearch{
  249 +}
  250 +.couponDialogBox {
  251 + max-height: 600px;
  252 + overflow-y: auto;
  253 +}
  254 +.formSearch{
259 255  
260   - display: flex;
261   - width: 100%;
262   - font-size: 14px;
263   - justify-content: space-between;
264   - // padding-bottom: 10px;
265   - align-items: center;
266   - margin: 20px 0;
  256 + display: flex;
  257 + width: 100%;
  258 + font-size: 14px;
  259 + justify-content: space-between;
  260 + // padding-bottom: 10px;
  261 + align-items: center;
  262 + margin: 20px 0;
267 263  
  264 +}
  265 + .tableBtn {
  266 + display: inline-block;
  267 + margin-right: 10px;
268 268 }
269   - .tableBtn {
270   - display: inline-block;
271   - margin-right: 10px;
272   - }
273 269  
274   - .greens {
275   - color: #3F9B6A;
276   - }
277   - ::v-deep .buttonHover:hover{
278   - color:#3f9b6a !important;
279   - border-color: #c5e1d2 !important;
280   - background-color: #ecf5f0 !important;
281   - outline: none;
282   - }
283   - ::v-deep .el-pagination__total {
284   - position: absolute;
285   - left: 10px;
286   - }
287   - ::v-deep .el-pagination.is-background .el-pager li:not(.disabled).active{
288   - background-color:#3f9b6a;
289   - }
290   - </style>
  270 +.greens {
  271 + color: #3F9B6A;
  272 + }
  273 + ::v-deep .buttonHover:hover{
  274 + color:#3f9b6a !important;
  275 + border-color: #c5e1d2 !important;
  276 + background-color: #ecf5f0 !important;
  277 + outline: none;
  278 + }
  279 + ::v-deep .el-pagination__total {
  280 + position: absolute;
  281 + left: 10px;
  282 + }
  283 + ::v-deep .el-pagination.is-background .el-pager li:not(.disabled).active{
  284 + background-color:#3f9b6a;
  285 + }
  286 +</style>
... ...
merchant-web-master/src/views/couponmanagement/couponlist.vue
1 1 <template>
2 2 <div style="background-color:#f7f7f7;padding:0 10px;">
3   - <div class="couponPage" v-show="type == '1'">
  3 + <div class="couponPage" v-if="type == '1'">
4 4 <div>
5 5 <!-- 搜索 -->
6 6 <div class="formSearch">
... ... @@ -34,9 +34,6 @@
34 34 <el-table-column label="优惠券名称" >
35 35 <template slot-scope="scope">{{ scope.row.couponName }}</template>
36 36 </el-table-column>
37   - <el-table-column label="资金池">
38   - <template slot-scope="scope">{{ scope.row.cereFundsPool?scope.row.cereFundsPool.poolName:'' }}</template>
39   - </el-table-column>
40 37 <el-table-column label="类型">
41 38 <template slot-scope="scope">
42 39 <span v-if="scope.row.couponType == '1'">满减券</span>
... ... @@ -66,7 +63,7 @@
66 63 </el-table>
67 64 <div style="display: flex;justify-content: space-between;" class="bom">
68 65 <div style="font-size: 14px;">共 <span style="color: #3F9B6A;">{{total}}</span> 项数据</div>
69   - <el-pagination :current-page="query.pageNumber" :page-sizes="[10, 20, 50, 100]" :page-size="10" background
  66 + <el-pagination :current-page="query.pageNumber+1" :page-sizes="[10, 20, 50, 100]" :page-size="10" background
70 67 small layout="prev, pager, next" :total="total" @size-change="handleSizeChange"
71 68 @current-change="handleCurrentChange">
72 69 </el-pagination>
... ... @@ -97,7 +94,7 @@
97 94 </el-dialog>
98 95 </div>
99 96 </div>
100   - <div class="couponPage" v-show="type == '2'">
  97 + <div class="couponPage" v-if="type == '2'">
101 98 <coupon :couponfrom="couponfrom" :coupoobj="coupoobj" @changevalue="changevalue"/>
102 99 <div class="footer">
103 100 <div class="btn_list" style="margin-top: 30px;">
... ... @@ -107,6 +104,16 @@
107 104 </div>
108 105 </div>
109 106 </div>
  107 + <div class="couponPage" v-show="type == '3'">
  108 + <!-- <div style="height:58px;line-height:58px;">
  109 + <div style="color:#0006"> <span>优惠券管理</span> <span style="padding:0 5px;">></span> <span
  110 + style="color:#000000e6">详情</span></div>
  111 + </div> -->
  112 + <allinfo ref="allinforef" :type="typeinfo" @changetypeinfo="changetypeinfo" />
  113 + <div style="display: flex;">
  114 + <el-button @click="changetype()" class="buttonHover" style="color: #606266;border: 1px solid #dddfe5;background-color: #fff;" >返回</el-button>
  115 + </div>
  116 + </div>
110 117 </div>
111 118 </template>
112 119  
... ... @@ -120,16 +127,21 @@
120 127 addcereCouponCategory
121 128 } from '@/api/couponmanagement/capitalpool.js'
122 129 import { getcereFundsPoolData}from '@/api/couponmanagement/couponlist.js'
  130 + import allinfo from './allinfo.vue';
123 131 import router from '@/router';
124 132 import coupon from './coupon.vue';
125 133 import TitleWithCircle from '@/components/top/index';
  134 + import {
  135 + getShopId
  136 +} from '@/utils/auth' // get token from cookie
126 137 export default {
127 138  
128 139 components: {
129   - coupon,TitleWithCircle
  140 + coupon,TitleWithCircle,allinfo
130 141 },
131 142 data() {
132 143 return {
  144 + typeinfo:'2',
133 145 couponRules: {
134 146 poolName: [{
135 147 required: true,
... ... @@ -157,6 +169,7 @@
157 169 useCategorylist:'',
158 170 usedMerchantslist:'',
159 171 couponfrom: {
  172 + receiveAgain:0,
160 173 usedMerchants: 2,
161 174 couponName: '',
162 175 remark: '',
... ... @@ -168,7 +181,7 @@
168 181 pointsRequired: 0,
169 182 startTime: '',
170 183 endTime: '',
171   - totalCoupons: null,
  184 + totalCoupons: 1,
172 185 totalFunds: null,
173 186 },
174 187 coupoobj: {},
... ... @@ -177,7 +190,7 @@
177 190 activityName: '', // 活动名称
178 191 // 活动状态 0-报名未开始 1-报名进行中 2-活动待开始 3-活动进行中 4-活动已结束
179 192 state: '',
180   - pageNumber: 1,
  193 + pageNumber: 0,
181 194 pageSize: 10
182 195 },
183 196 total: 0,
... ... @@ -211,21 +224,23 @@
211 224 },
212 225 created() {
213 226 this.getAll()
  227 + console.error(getShopId())
214 228 },
215 229 methods: {
  230 + changetype() {
  231 + this.type = 1
  232 + },
  233 + changetypeinfo(e) {
  234 + this.typeinfo = e
  235 + },
216 236 changevalue(e,list) {
217 237 console.error(e,list )
218 238 this[e] = list
219 239 },
220 240 xq(e) {
221 241 console.log(e )
222   - // 跳转路由
223   - router.push({
224   - path: '/other/coupon',
225   - query: {
226   - id: e.poolId
227   - }
228   - })
  242 + this.type = '3'
  243 + this.$refs.allinforef.int(e.id)
229 244 },
230 245 savecoupon() {
231 246 let that = this
... ... @@ -273,9 +288,19 @@
273 288 })
274 289 console.error(JSON.stringify(from))
275 290 // return
  291 + let clist = []
  292 + clist.push(getShopId())
276 293 cereCouponMainTable(from).then(res => {
277 294 console.error(res)
278 295 if (res.data) {
  296 + let info1 = {
  297 + couponId:res.data.id,
  298 + usedMerchants:3,
  299 + categoryIds:clist
  300 + }
  301 + addcereCouponCategory(info1).then(res2 => {
  302 + console.error(res2)
  303 + })
279 304 if(res.data.usedMerchants == '2') {
280 305 let info2 = {
281 306 couponId:res.data.id,
... ... @@ -290,15 +315,29 @@
290 315 message: '提交成功',
291 316 type: 'success'
292 317 });
  318 + that.type = '1'
  319 + that.clear()
  320 + that.couponfrom={
  321 + usedMerchants: 2,
  322 + couponName: '',
  323 + remark: '',
  324 + couponType: '1', // 默认值
  325 + useCategory: 1,
  326 + maxDiscountAmount: null,
  327 + usageThreshold: null, //使用门槛不用
  328 + discountContent: null,
  329 + pointsRequired: 0,
  330 + startTime: '',
  331 + endTime: '',
  332 + totalCoupons: null,
  333 + totalFunds: null,
  334 + }
293 335 } else {
294 336 that.$message({
295 337 message: '提交失败',
296 338 error: 'success'
297 339 });
298 340 }
299   - setTimeout(() => {
300   - that.type = '1'
301   - }, 2000)
302 341 })
303 342 },
304 343 changecouponfrom() {
... ... @@ -413,7 +452,7 @@
413 452 }
414 453 },
415 454 async getAll() {
416   - const res = await getcereFundsPoolData(this.query)
  455 + const res = await getcereFundsPoolData({'shopId':getShopId(),...this.query})
417 456 this.tableData = res.data.content
418 457 this.total = res.data.numberOfElements
419 458 },
... ... @@ -422,12 +461,12 @@
422 461 this.getAll()
423 462 },
424 463 handleCurrentChange(val) {
425   - this.query.pageNumber = val
  464 + this.query.pageNumber = val-1
426 465 this.getAll()
427 466 },
428 467 search() {
429 468 this.total = 1
430   - this.query.pageNumber = 1
  469 + this.query.pageNumber = 0
431 470 this.getAll()
432 471 },
433 472 // 重置
... ... @@ -435,7 +474,7 @@
435 474 this.query = {
436 475 activityName: '',
437 476 state: '',
438   - pageNumber: 1,
  477 + pageNumber: 0,
439 478 pageSize: 10
440 479 }
441 480 this.getAll()
... ...
merchant-web-master/src/views/marketing/coupon/add copy.vue 0 → 100644
  1 +<template>
  2 + <div class="addCoupon">
  3 + <!-- 新增用户 -->
  4 + <div class="addCouponBox">
  5 + <el-form ref="ruleForm" class="formBox" :model="addForm" label-width="150px" :rules="couponRules">
  6 + <el-form-item label="优惠券类型">
  7 + <el-radio v-model="addForm.couponType" label="1">满减券</el-radio>
  8 + <el-radio v-model="addForm.couponType" label="2">折扣券</el-radio>
  9 + </el-form-item>
  10 + <el-form-item label="优惠券名称" prop="couponName">
  11 + <el-input v-model="addForm.couponName" placeholder="请输入优惠券名称" onblur="value=value.replace(/(^\s*)|(\s*$)/g, '')" />
  12 + </el-form-item>
  13 + <el-form-item label="备注">
  14 + <el-input v-model="addForm.remark" placeholder="请输入备注" />
  15 + </el-form-item>
  16 + <el-form-item class="applyType" label="适用商品" prop="applyType">
  17 + <el-radio v-model="addForm.applyType" label="1" >全部商品</el-radio>
  18 + <el-radio
  19 + v-model="addForm.applyType"
  20 + label="2"
  21 +
  22 + @change="chooseProduct(type = '2')"
  23 + >指定商品可用</el-radio>
  24 + <span class="selectBtn" @click="chooseProduct(type = '2')">
  25 + 请选择
  26 + <i v-if="addForm.applyType === '2' && idList.length !== 0" class="selectNum">
  27 + {{ idList.length }}
  28 + </i>
  29 + </span>
  30 + <el-radio
  31 + v-model="addForm.applyType"
  32 + label="3"
  33 +
  34 + @change="chooseProduct(type = '3')"
  35 + >指定商品不可用</el-radio>
  36 + <span class="selectBtn" @click="chooseProduct(type = '3')">
  37 + 请选择
  38 + <i v-if="addForm.applyType === '3' && idList.length !== 0" class="selectNum">
  39 + {{ idList.length }}
  40 + </i>
  41 + </span>
  42 + </el-form-item>
  43 + <el-form-item class="inputW" label="使用门槛" prop="threshold">
  44 + <!-- 订单满<el-input v-model="addForm.threshold" :disabled="isThreshold" type="number" oninput="value=value.replace(/-/, '')" />元 -->
  45 + 订单满 <el-input-number v-model="addForm.threshold" :disabled="isThreshold" :controls="false" :min="0" :precision="2" :step="0.01" /> 元
  46 + <el-checkbox v-model="isThreshold" @change="changeThreshold" >无门槛</el-checkbox>
  47 + </el-form-item>
  48 + <el-form-item v-if="addForm.couponType === '1'" class="inputW" label="优惠内容" prop="couponContent">
  49 + <!-- 减<el-input v-model="addForm.couponContent" type="number" />元 -->
  50 + 减 <el-input-number v-model="addForm.couponContent" :controls="false" :min="0" :precision="2" :step="0.01" /> 元
  51 + </el-form-item>
  52 + <el-form-item v-else class="inputW discount" label="优惠内容" prop="couponContent">
  53 + <!-- 打<el-input v-model="addForm.couponContent" type="number" />折 -->
  54 + 打 <el-input-number v-model="addForm.couponContent" :controls="false" :min="0.1" :max="9.9" :precision="1" :step="0.1" /> 折
  55 + <label>输入值要大于0 小于10,可保留一位小数</label>
  56 + </el-form-item>
  57 + <el-form-item class="timeDataBox" label="用券时间">
  58 + <el-radio v-model="addForm.timeType" label="1" >固定时间</el-radio>
  59 + <div class="dateBox">
  60 + <el-form-item>
  61 + <el-date-picker
  62 + v-model="dateInfo"
  63 + :disabled="addForm.timeType === '2'"
  64 + type="datetimerange"
  65 +
  66 + range-separator="至"
  67 + start-placeholder="开始日期"
  68 + end-placeholder="结束日期"
  69 + value-format="yyyy-MM-dd HH:mm:ss"
  70 + />
  71 + </el-form-item>
  72 + </div>
  73 + </el-form-item>
  74 + <el-form-item class="boxWidth">
  75 + <el-radio v-model="addForm.timeType" label="2" >领券当日起</el-radio>
  76 + <el-input v-model="addForm.effectiveDay" :disabled="addForm.timeType !== '2'" oninput="value=value.replace(/[^\d]/g,'')" type="number" />天内可用
  77 + </el-form-item>
  78 + <el-form-item class="boxWidth" label="发放数量" prop="number">
  79 + <el-input v-model="addForm.number" type="number" oninput="value=value.replace(/[^\d]/g,'')" />张
  80 + </el-form-item>
  81 + <el-form-item class="boxWidth" label="每人限领次数">
  82 + <el-radio v-model="addForm.receiveType" label="1" >无限制</el-radio>
  83 + <el-radio v-model="addForm.receiveType" label="2" >限制</el-radio>
  84 + <el-input v-model="addForm.frequency" :disabled="addForm.receiveType === '1'" oninput="value=value.replace(/[^\d]/g,'')" type="number" />次
  85 + </el-form-item>
  86 + <el-form-item label="叠加平台优惠">
  87 + <el-radio-group v-model="addForm.ifAdd" >
  88 + <el-radio label="0">不叠加</el-radio>
  89 + <el-radio label="1">叠加</el-radio>
  90 + </el-radio-group>
  91 + </el-form-item>
  92 + </el-form>
  93 + </div>
  94 + <span slot="footer" class="dialog-footer">
  95 + <el-button @click="addCouponFn('ruleForm')" style="background-color: #3F9B6A;color: #fff" >保 存</el-button>
  96 + <el-button @click="goToCoupon" class="buttonHover"
  97 + style="color: #606266;border: 1px solid #dddfe5;background-color: #fff;">取 消</el-button>
  98 + </span>
  99 + <!-- 新建分组弹框 -->
  100 + <el-dialog
  101 + title="选择商品"
  102 + :visible.sync="isVisible"
  103 + width="70%"
  104 + top="50px"
  105 + class="group-dialog"
  106 + :close-on-click-modal="false"
  107 + :modal-append-to-body="false"
  108 + :modal="false"
  109 + >
  110 + <!-- 表格 -->
  111 + <div class="tableBox">
  112 + <el-table
  113 + ref="multipleTable"
  114 + :data="tableData"
  115 + border
  116 + :header-cell-style="{fontSize: '12px', backgroundColor: '#FAFAFA',color:'#000',fontWeight: 'normal'}"
  117 + tooltip-effect="dark"
  118 + style="width: 100%"
  119 + :row-key="getRowKeys"
  120 + max-height="600"
  121 + @selection-change="handleSelectionChange"
  122 + >
  123 + <el-table-column
  124 + type="selection"
  125 + :reserve-selection="true"
  126 + width="55"
  127 + />
  128 + <el-table-column label="产品主图" width="220" align="center">
  129 + <template slot-scope="scope">
  130 + <img height="80" width="80" :src="scope.row.image " alt srcset>
  131 + </template>
  132 + </el-table-column>
  133 + <el-table-column prop="productName" label="产品名称" width="220" />
  134 + <el-table-column prop="productId" label="产品id" show-overflow-tooltip />
  135 + <!-- <el-table-column prop="discountPrice" label="售价(元)" show-overflow-tooltip />-->
  136 + <el-table-column prop="originalPrice" label="原价(元)" show-overflow-tooltip />
  137 + <el-table-column prop="stockNumber" label="库存(件)" show-overflow-tooltip />
  138 + <!-- <el-table-column prop="volume" label="销量" show-overflow-tooltip />-->
  139 + </el-table>
  140 + <div class="fenye">
  141 + <el-pagination
  142 + :current-page="proOption.page"
  143 + :page-sizes="[10, 20, 50, 100]"
  144 + :page-size="proOption.pageSize"
  145 + background
  146 + small
  147 + layout="total, sizes, prev, pager, next, jumper"
  148 + :total="total"
  149 + @size-change="handleSizeChange"
  150 + @current-change="handleCurrentChange"
  151 + />
  152 + </div>
  153 + <div class="footBtnBox">
  154 + <span slot="footer">
  155 + <el-button type="primary" @click="saveIdList" >确 定</el-button>
  156 + <el-button @click="closeSelect" >取 消</el-button>
  157 + </span>
  158 + </div>
  159 + </div>
  160 + </el-dialog>
  161 + </div>
  162 +</template>
  163 +
  164 +<script>
  165 +import { addCoupon, getProducts, couponDetail, updateCoupon } from '@/api/marketing'
  166 +
  167 +function InitCouponForm() {
  168 + this.type = 1
  169 + this.applyType = '1' // 适用商品 1-全部商品 2-指定商品可用 3-指定商品不可用
  170 + this.couponContent = null // 优惠内容减多少元
  171 + this.couponName = '' // 优惠券名称
  172 + this.couponType = '1' // 优惠券类型 1-满减券 2-折扣券
  173 + this.effectiveDay = null // 领券当日几天内(天数)
  174 + this.effectiveStart = '' // 用券开始时间
  175 + this.effectiveEnd = '' // 用券结束时间
  176 + this.frequency = null // 限制次数
  177 + this.ids = [] // 选中的商品id数组
  178 + this.ifAdd = '0' // 是否叠加平台优惠 1-是 0-否
  179 + this.number = null // 发放数量
  180 + this.receiveType = '1' // 每人限领次数 1-无限次 2-限制几次
  181 + this.remark = '' // 备注
  182 + this.shopCouponId = null // 店铺优惠券id
  183 + this.threshold = '0' // 使用门槛满多少元,无门槛为0
  184 + this.timeType = '1' // 用券时间 1-固定时间 2-领券当日起几天内可用
  185 +}
  186 +export default {
  187 + name: 'AddCoupon',
  188 + props: {
  189 + couponId: {
  190 + type: Number,
  191 + default: 0
  192 + }
  193 + },
  194 + data() {
  195 + return {
  196 + // 新增
  197 + getRowKeys(row) {
  198 + return row.productId
  199 + },
  200 + addForm: new InitCouponForm(),
  201 + proOption: {
  202 + page: 1,
  203 + pageSize: 10
  204 + },
  205 + dateInfo: [],
  206 + idList: [],
  207 + isThreshold: true,
  208 + total: 0,
  209 + tableData: [],
  210 + currentType: '1',
  211 + shopCouponId: '', // 优惠券ID
  212 + couponRules: {
  213 + couponName: [
  214 + { required: true, message: '请输入优惠券名称', trigger: 'blur' }
  215 + ],
  216 + couponContent: [{ required: true, message: '请输入优惠金额' }],
  217 + dateInfo: [{ type: 'date', required: true, message: '请选择时间' }],
  218 + number: [{ required: true, message: '请输入发放数量', trigger: 'blur' }]
  219 + },
  220 + multipleSelection: [],
  221 + roleList: [],
  222 + isVisible: false // 选择商品弹窗
  223 + }
  224 + },
  225 + watch: {
  226 + couponId: {
  227 + handler(nVal, oVal) {
  228 + this.shopCouponId = nVal
  229 + console.log('this.shopCouponId', this.shopCouponId)
  230 + if (!nVal) {
  231 + this.addForm = new InitCouponForm()
  232 + } else {
  233 + this.getCouponInfo()
  234 + }
  235 + this.$nextTick(() => {
  236 + console.log('multipleTable', this.$refs.multipleTable)
  237 + })
  238 + }
  239 + }
  240 + },
  241 + mounted() {
  242 + console.log('mounted-------')
  243 + this.shopCouponId = this.couponId
  244 + if (this.shopCouponId) {
  245 + this.getCouponInfo()
  246 + }
  247 + },
  248 + methods: {
  249 + resetData() {
  250 + if (this.$refs.multipleTable) {
  251 + this.$refs.multipleTable.clearSelection()
  252 + this.idList = []
  253 + }
  254 + },
  255 + proving1(e) {
  256 + var keynum = window.event ? e.keyCode : e.which // 获取键盘码
  257 + // var keychar = String.fromCharCode(keynum) // 获取键盘码对应的字符
  258 + if (
  259 + e.key
  260 + .replace(/[^\d^\.]+/g, '')
  261 + .replace('.', '$#$')
  262 + .replace(/\./g, '')
  263 + .replace('$#$', '.') === '' &&
  264 + keynum !== 8
  265 + ) {
  266 + this.$message.warning('禁止输入中文或空')
  267 + e.target.value = ' '
  268 + }
  269 + },
  270 + addCouponFn(ruleForm) {
  271 + this.$refs[ruleForm].validate(valid => {
  272 + if (valid) {
  273 + if (this.addForm.timeType === '1' && this.dateInfo.length === 0) {
  274 + this.$message({
  275 + message: '请选择用券时间开始和结束日期',
  276 + type: 'warning'
  277 + })
  278 + return false
  279 + }
  280 + if (this.addForm.timeType === '2' && this.addForm.effectiveDay === null) {
  281 + this.$message({
  282 + message: '请填写领券多久内可以使用时间',
  283 + type: 'warning'
  284 + })
  285 + return false
  286 + }
  287 + if (this.addForm.receiveType === ' 2' && this.addForm.frequency === null) {
  288 + this.$message({
  289 + message: '请填写每人限领次数',
  290 + type: 'warning'
  291 + })
  292 + return false
  293 + }
  294 + if (this.addForm.couponType === '2') {
  295 + var regExp = /^([1-9]{1})(.\d{1})?$/
  296 + if (!regExp.test(this.addForm.couponContent)) {
  297 + this.$message({
  298 + message: '格式输入不正确',
  299 + type: 'warning'
  300 + })
  301 + return false
  302 + }
  303 + }
  304 + if ([2, 3].includes(parseInt(this.addForm.applyType))) {
  305 + if (!this.addForm.ids || !this.addForm.ids.length || this.addForm.ids.length === 0) {
  306 + this.$message({
  307 + message: '请选择指定商品',
  308 + type: 'warning'
  309 + })
  310 + return false
  311 + }
  312 + }
  313 + this.addForm.effectiveStart = this.dateInfo[0]
  314 + this.addForm.effectiveEnd = this.dateInfo[1]
  315 + if (this.shopCouponId) {
  316 + updateCoupon(this.addForm).then(res => {
  317 + if (res.code === '') {
  318 + this.$message.success('修改成功')
  319 + this.addForm = new InitCouponForm()
  320 + this.$emit('reset')
  321 + } else {
  322 + this.$message.error(res.message)
  323 + }
  324 + })
  325 + } else {
  326 + addCoupon(this.addForm).then(res => {
  327 + if (res.code === '') {
  328 + this.$message.success('提交成功')
  329 + this.addForm = new InitCouponForm()
  330 + this.$emit('reset')
  331 + } else {
  332 + this.$message.error(res.message)
  333 + }
  334 + })
  335 + }
  336 + } else {
  337 + console.log('error submit!!')
  338 + return false
  339 + }
  340 + })
  341 + },
  342 + handleSizeChange(val) {
  343 + this.proOption.pageSize = val
  344 + this.getProList()
  345 + },
  346 + handleCurrentChange(val) {
  347 + this.proOption.page = val
  348 + this.getProList()
  349 + },
  350 + // 选择商品
  351 + chooseProduct(type) {
  352 + this.isVisible = true
  353 + if (this.currentType !== type) {
  354 + this.idList = []
  355 + if (this.multipleSelection.length !== 0) {
  356 + this.$refs.multipleTable.clearSelection()
  357 + }
  358 + }
  359 + this.currentType = type
  360 + this.getProList()
  361 + },
  362 + getProList() {
  363 + getProducts(this.proOption).then(res => {
  364 + if (res.code === '') {
  365 + this.tableData = res.data.list
  366 + this.total = res.data.total
  367 + // 点击编辑时回显表格勾选
  368 + if (this.shopCouponId) {
  369 + for (let i = 0; i < this.tableData.length; i++) {
  370 + if (this.idList.includes(this.tableData[i].productId)) {
  371 + this.$refs.multipleTable.toggleRowSelection(this.tableData[i])
  372 + }
  373 + }
  374 + }
  375 + }
  376 + })
  377 + },
  378 + // 选中商品
  379 + handleSelectionChange(val) {
  380 + this.multipleSelection = val
  381 + },
  382 + // 保存选择商品ID
  383 + saveIdList() {
  384 + const idList = []
  385 + this.multipleSelection.forEach(i => {
  386 + idList.push(i.productId)
  387 + })
  388 + this.idList = idList
  389 + console.log('idList.length', idList.length)
  390 + this.addForm.ids = idList
  391 + this.addForm.applyType = this.currentType
  392 + this.isVisible = false
  393 + },
  394 + // 取消选择
  395 + closeSelect() {
  396 + this.isVisible = false
  397 + },
  398 + // 跳转优惠券列表
  399 + goToCoupon() {
  400 + this.$emit('reset')
  401 + },
  402 + async getCouponInfo() {
  403 + const res = await couponDetail({ shopCouponId: this.shopCouponId })
  404 + this.addForm = res.data
  405 + this.addForm.applyType = res.data.applyType.toString()
  406 + this.addForm.couponContent = res.data.couponContent
  407 + this.addForm.couponName = res.data.couponName
  408 + this.addForm.couponType = res.data.couponType.toString()
  409 + this.addForm.effectiveDay = res.data.effectiveDay
  410 + this.addForm.effectiveStart = res.data.effectiveStart
  411 + this.addForm.effectiveEnd = res.data.effectiveEnd
  412 + this.addForm.frequency = res.data.frequency
  413 + this.addForm.ids = res.data.ids
  414 + this.addForm.ifAdd = res.data.ifAdd.toString()
  415 + this.addForm.number = res.data.number
  416 + this.addForm.receiveType = res.data.receiveType.toString()
  417 + this.addForm.remark = res.data.remark
  418 + this.addForm.shopCouponId = res.data.shopCouponId
  419 + this.addForm.threshold = res.data.threshold.toString()
  420 + this.addForm.timeType = res.data.timeType.toString()
  421 + this.dateInfo = [this.addForm.effectiveStart, this.addForm.effectiveEnd]
  422 + if (this.addForm.applyType === '2') {
  423 + this.addForm.products.forEach(item => {
  424 + this.idList.push(item.productId)
  425 + })
  426 + } else if (this.addForm.applyType === '3') {
  427 + this.addForm.excludeIds.forEach(item => {
  428 + this.idList.push(item)
  429 + })
  430 + } else {
  431 + this.idList = []
  432 + }
  433 + this.currentType = res.data.applyType.toString()
  434 + },
  435 + changeThreshold(val) { // 输入框值改变
  436 + if (val) {
  437 + this.addForm.threshold = 0
  438 + }
  439 + },
  440 + }
  441 +}
  442 +</script>
  443 +<style lang='scss' scoped>
  444 +//@import url(); 引入公共css类
  445 +@import url("../../../styles/elDialog.scss");
  446 +.addCoupon {
  447 + background: #FFFFFF;
  448 + .dialog-footer {
  449 + margin-left: 300px;
  450 + }
  451 + .formBox {
  452 + .flexBox {
  453 + display: flex;
  454 + }
  455 + .applyType {
  456 + span {
  457 + width: 100px;
  458 + height: 30px;
  459 + line-height: 30px;
  460 + background: #3F9B6A;
  461 + color: #FFFFFF;
  462 + text-align: center;
  463 + display: inline-block;
  464 + font-size: 14px;
  465 + margin-right: 30px;
  466 + border-radius: 4px;
  467 + cursor: pointer;
  468 + position: relative;
  469 + i {
  470 + position: absolute;
  471 + right: -10px;
  472 + top: -10px;
  473 + width: 25px;
  474 + height: 25px;
  475 + line-height: 25px;
  476 + background: #FFFFFF;
  477 + border-radius: 50%;
  478 + border: 1px solid #3F9B6A;
  479 + text-align: center;
  480 + color: #3F9B6A;
  481 + font-style: normal;
  482 + font-size: 12px;
  483 + }
  484 + }
  485 + }
  486 + }
  487 +.footBtnBox {
  488 + width: 100%;
  489 + display: flex;
  490 + justify-content: center;
  491 + margin-top: 50px;
  492 +}
  493 + .dateBox {
  494 + display: flex;
  495 + align-items: center;
  496 + .description {
  497 + width: 59px;
  498 + text-align: center;
  499 + display: block;
  500 + font-size: 14px;
  501 + color: #999999;
  502 + }
  503 + }
  504 + .discount label {
  505 + color: #cccccc;
  506 + font-weight: 500;
  507 + padding-left: 30px;
  508 + }
  509 +}
  510 +
  511 +</style>
  512 +<style scoped>
  513 +.flexBox /deep/ .el-input {
  514 + width: 300px;
  515 +}
  516 +.inputW /deep/ .el-input, .el-input-number {
  517 + width: 100px;
  518 + /* margin: 0 8px; */
  519 +}
  520 +.inputW /deep/ .el-input .el-input__inner {
  521 + text-align: center;
  522 +}
  523 +.inputW /deep/ .el-form-item__error {
  524 + padding-left: 25px;
  525 +}
  526 +.inputW /deep/ .el-checkbox {
  527 + margin-left: 20px;
  528 +}
  529 +.inputW /deep/ .el-radio {
  530 + margin-left: 30px;
  531 +}
  532 +.boxWidth /deep/ .el-input {
  533 + width: 100px;
  534 + margin-right: 15px;
  535 +}
  536 +.boxWidth /deep/ .el-input .el-input__inner {
  537 + text-align: center;
  538 +}
  539 +.addCoupon /deep/ .el-button--primary {
  540 + background: #3F9B6A;
  541 + border-color: #3F9B6A;
  542 +}
  543 +.addCoupon /deep/ .el-dialog__header {
  544 + background-color: #3F9B6A;
  545 +}
  546 +.addCoupon /deep/ .el-dialog__headerbtn .el-dialog__close {
  547 + color: #FFFFFF;
  548 +}
  549 +.addCoupon .timeDataBox /deep/ .el-form-item__content {
  550 + display: flex;
  551 + align-items: center;
  552 +}
  553 +.addCoupon .timeDataBox /deep/ .el-form-item__label {}
  554 +input::-webkit-outer-spin-button,
  555 +input::-webkit-inner-spin-button {
  556 + -webkit-appearance: none;
  557 +}
  558 +input[type="number"]{
  559 + -moz-appearance: textfield;
  560 +}
  561 +
  562 +</style>
... ...
merchant-web-master/src/views/marketing/coupon/add.vue
1 1 <template>
2 2 <div class="addCoupon">
  3 + <TitleWithCircle title="基本信息" style="padding: 10px 0;padding-left: 30px;padding-bottom: 20px;"/>
3 4 <!-- 新增用户 -->
4 5 <div class="addCouponBox">
5 6 <el-form ref="ruleForm" class="formBox" :model="addForm" label-width="150px" :rules="couponRules">
... ... @@ -14,7 +15,7 @@
14 15 <el-input v-model="addForm.remark" placeholder="请输入备注" />
15 16 </el-form-item>
16 17 <el-form-item class="applyType" label="适用商品" prop="applyType">
17   - <el-radio v-model="addForm.applyType" label="1" >全部商品</el-radio>
  18 + <!-- <el-radio v-model="addForm.applyType" label="1" >全部商品</el-radio> -->
18 19 <el-radio
19 20 v-model="addForm.applyType"
20 21 label="2"
... ... @@ -83,18 +84,18 @@
83 84 <el-radio v-model="addForm.receiveType" label="2" >限制</el-radio>
84 85 <el-input v-model="addForm.frequency" :disabled="addForm.receiveType === '1'" oninput="value=value.replace(/[^\d]/g,'')" type="number" />次
85 86 </el-form-item>
86   - <el-form-item label="叠加平台优惠">
  87 + <!-- <el-form-item label="叠加平台优惠">
87 88 <el-radio-group v-model="addForm.ifAdd" >
88 89 <el-radio label="0">不叠加</el-radio>
89 90 <el-radio label="1">叠加</el-radio>
90 91 </el-radio-group>
91   - </el-form-item>
  92 + </el-form-item> -->
92 93 </el-form>
93 94 </div>
94 95 <span slot="footer" class="dialog-footer">
95 96 <el-button @click="addCouponFn('ruleForm')" style="background-color: #3F9B6A;color: #fff" >保 存</el-button>
96 97 <el-button @click="goToCoupon" class="buttonHover"
97   - style="color: #606266;border: 1px solid #dddfe5;background-color: #fff;">取 消</el-button>
  98 + style="color: #606266;border: 1px solid #dddfe5;background-color: #fff;margin-right: 20px;">取 消</el-button>
98 99 </span>
99 100 <!-- 新建分组弹框 -->
100 101 <el-dialog
... ... @@ -163,10 +164,10 @@
163 164  
164 165 <script>
165 166 import { addCoupon, getProducts, couponDetail, updateCoupon } from '@/api/marketing'
166   -
  167 +import TitleWithCircle from '@/components/top/index';
167 168 function InitCouponForm() {
168 169 this.type = 1
169   - this.applyType = '1' // 适用商品 1-全部商品 2-指定商品可用 3-指定商品不可用
  170 + this.applyType = '2' // 适用商品 1-全部商品 2-指定商品可用 3-指定商品不可用
170 171 this.couponContent = null // 优惠内容减多少元
171 172 this.couponName = '' // 优惠券名称
172 173 this.couponType = '1' // 优惠券类型 1-满减券 2-折扣券
... ... @@ -191,6 +192,9 @@ export default {
191 192 default: 0
192 193 }
193 194 },
  195 + components: {
  196 + TitleWithCircle
  197 + },
194 198 data() {
195 199 return {
196 200 // 新增
... ... @@ -446,7 +450,10 @@ export default {
446 450 .addCoupon {
447 451 background: #FFFFFF;
448 452 .dialog-footer {
449   - margin-left: 300px;
  453 + // margin-left: 300px;
  454 + display: flex;
  455 + flex-direction: row-reverse;
  456 + margin-top: 30px;
450 457 }
451 458 .formBox {
452 459 .flexBox {
... ...
merchant-web-master/src/views/marketing/coupon/index copy.vue 0 → 100644
  1 +<template>
  2 + <div style="padding: 0 10px;background-color:#f7f7f7;">
  3 + <div class="pending">
  4 + <div class="formSearch">
  5 + <el-form :inline="true" :model="formInline" class="demo-form-inline">
  6 + <el-form-item label="优惠券名称">
  7 + <el-input v-model="formInline.couponName" placeholder="请输入内容"
  8 + style="width: 180px;margin-right: 15px" />
  9 + </el-form-item>
  10 + <el-form-item label="优惠券类型">
  11 + <el-select v-model="formInline.couponType" placeholder="请选择优惠券类型"
  12 + style="width: 180px;margin-right: 15px">
  13 + <el-option label="全部" :value="null" />
  14 + <el-option label="满减券" value="1" />
  15 + <el-option label="折扣券" value="2" />
  16 + </el-select>
  17 + </el-form-item>
  18 + <el-form-item label="状态">
  19 + <el-select v-model="formInline.state" placeholder="请选择优惠券状态"
  20 + style="width: 180px;margin-right: 15px">
  21 + <el-option label="全部" :value="null" />
  22 + <el-option label="未开始" value="0" />
  23 + <el-option label="进行中" value="1" />
  24 + <el-option label="已结束" value="2" />
  25 + </el-select>
  26 + </el-form-item>
  27 + <el-form-item label="创建时间">
  28 + <el-date-picker
  29 + v-model="formInline.dates"
  30 +
  31 + style="width: 250px;margin-right: 15px"
  32 + type="datetimerange"
  33 + range-separator="至"
  34 + start-placeholder="开始日期"
  35 + end-placeholder="结束日期"
  36 + value-format="yyyy-MM-dd HH:mm:ss"
  37 + />
  38 + </el-form-item>
  39 + <el-form-item>
  40 +
  41 +
  42 + </el-form-item>
  43 + </el-form>
  44 + <div>
  45 + <el-button @click="search" style="background-color: #3F9B6A;color:#fff;" >查询</el-button>
  46 + <el-button @click="clear" class="buttonHover"
  47 + style="color: #606266;border: 1px solid #dddfe5;background-color: #fff;">重置</el-button>
  48 + </div>
  49 + </div>
  50 + <div style="margin-bottom:20px;">
  51 + <el-button @click="addActivity" style="background-color: #3F9B6A;color:#fff;">新增</el-button>
  52 + </div>
  53 + <!-- 表格 -->
  54 + <div class="tableBox">
  55 + <el-table
  56 + ref="multipleTable"
  57 + :data="tableData"
  58 + :header-cell-style="{fontSize: '14px',color:'#0009',fontWeight: 'normal',backgroundColor:'#F2F3F5'}"
  59 + tooltip-effect="dark"
  60 + >
  61 + <el-table-column label="优惠券名称" width="220">
  62 + <template slot-scope="scope">{{ scope.row.couponName }}</template>
  63 + </el-table-column>
  64 + <el-table-column label="类型" show-overflow-tooltip>
  65 + <template slot-scope="scope">
  66 + <span v-if="scope.row.couponType === 1">满减券</span>
  67 + <span v-if="scope.row.couponType === 2">折扣券</span>
  68 + </template>
  69 + </el-table-column>
  70 + <el-table-column label="状态" show-overflow-tooltip>
  71 + <template slot-scope="scope">
  72 + <span v-if="scope.row.state === 0">未开始</span>
  73 + <span v-if="scope.row.state === 1">进行中</span>
  74 + <span v-if="scope.row.state === 2">已结束</span>
  75 + </template>
  76 + </el-table-column>
  77 + <el-table-column prop="content" label="内容" show-overflow-tooltip />
  78 + <el-table-column prop="createTime" label="创建时间" show-overflow-tooltip />
  79 + <el-table-column label="操作" show-overflow-tooltip>
  80 + <template slot-scope="scope">
  81 + <div class="btnList">
  82 + <div v-if="scope.row.state === 0" type="text" @click="editActivity(scope.row.shopCouponId)"
  83 + class="tableBtn greens">编辑</div>
  84 + <div v-if="scope.row.state !== 0" type="text" @click="showData(scope.row.shopCouponId)"
  85 + class="tableBtn greens">数据</div>
  86 + <el-popconfirm v-if="scope.row.state === 0 || scope.row.state === 2" title="确定删除此券?" @onConfirm="delCouponFn(scope.row)">
  87 + <div slot="reference" type="text"
  88 + class="tableBtn greens">删除</div>
  89 + </el-popconfirm>
  90 + <el-popconfirm v-if="scope.row.state === 1" title="是否停止此活动?" @onConfirm="stopFn(scope.row.shopCouponId)">
  91 + <div slot="reference" type="text"
  92 + class="tableBtn greens">停止</div>
  93 + </el-popconfirm>
  94 + </div>
  95 + </template>
  96 + </el-table-column>
  97 + </el-table>
  98 + <div class="fenye">
  99 + <el-pagination
  100 + :current-page="formInline.page"
  101 + :page-sizes="[10, 20, 50, 100]"
  102 + :page-size="10"
  103 + background
  104 + small
  105 + layout="prev, pager, next,total"
  106 + :total="total"
  107 + @size-change="handleSizeChange"
  108 + @current-change="handleCurrentChange"
  109 + />
  110 + </div>
  111 + </div>
  112 +
  113 + <!-- 新增活动 -->
  114 + <el-dialog
  115 + :title="activityId ? '修改优惠券' : '新增优惠券'"
  116 + :visible.sync="activityVisible"
  117 + width="55%"
  118 + center
  119 + custom-class="bian_css"
  120 + :close-on-click-modal="false"
  121 + @close="closeModal"
  122 + >
  123 + <AddCoupon
  124 + ref="addCoupon"
  125 + :coupon-id="activityId"
  126 + @reset="reset"
  127 + />
  128 + </el-dialog>
  129 + <!-- 数据展示 -->
  130 + <el-dialog
  131 + :close-on-click-modal="false"
  132 + title="数据效果"
  133 + :visible.sync="isDataVisible"
  134 + width="50%"
  135 +custom-class="bian_css"
  136 + >
  137 + <!-- 表格 -->
  138 + <div class="dataEffect" style="padding:20px;">
  139 + <h3>数据统计至昨日</h3>
  140 + <div class="couponTit">优惠券名称:{{ dataInfo.couponName }}</div>
  141 + <div class="couponTit">
  142 + 优惠券总数:{{ dataInfo.couponTotal?dataInfo.couponTotal:'0' }} 张,已领取 {{ dataInfo.received?dataInfo.received:'0' }} 张
  143 + </div>
  144 + <div class="dataListBox">
  145 + <div class="dataItem">
  146 + <span>¥{{ dataInfo.total }}</span>
  147 + <p>用券成交总额</p>
  148 + </div>
  149 + <div class="dataItem">
  150 + <span>¥{{ dataInfo.useMoney }}</span>
  151 + <p>使用优惠券总额</p>
  152 + </div>
  153 + <div class="dataItem">
  154 + <span>{{ dataInfo.count }}件</span>
  155 + <p>购买商品总数</p>
  156 + </div>
  157 + </div>
  158 + <div class="tabListInfo">使用该优惠券购买的商品</div>
  159 + <div class="tableBox">
  160 + <el-table
  161 + ref="multipleTable"
  162 + :data="dataInfo.products"
  163 + height="150"
  164 + :header-cell-style="{fontSize: '14px',color:'#0009',fontWeight: 'normal',backgroundColor:'#F2F3F5'}"
  165 + tooltip-effect="dark"
  166 + >
  167 + <el-table-column prop="productName" label="商品名称" show-overflow-tooltip />
  168 + <el-table-column prop="number" label="付款件数" show-overflow-tooltip />
  169 + <el-table-column prop="users" label="付款人数" show-overflow-tooltip />
  170 + </el-table>
  171 + </div>
  172 + </div>
  173 + </el-dialog>
  174 + </div>
  175 + </div>
  176 +</template>
  177 +
  178 +<script>
  179 +import AddCoupon from '@/views/marketing/coupon/add.vue'
  180 +import { getCoupon, delCoupon, getCouponData, stopCoupon } from '@/api/marketing'
  181 +import activityMixin from '@/views/marketing/mixin/index.js'
  182 +
  183 +function CouponQueryForm() {
  184 + this.couponName = '' // 优惠券名称
  185 + this.couponType = null // 优惠券类型
  186 + this.dates = [] // 创建时间数组
  187 + this.endTime = '' // 创建时间结束时间
  188 + this.page = 1 // 当前页
  189 + this.pageSize = 10 // 每页记录数
  190 + this.startTime = '' // 创建时间开始时间
  191 + this.state = null // 优惠券状态
  192 +}
  193 +export default {
  194 + name: 'Coupon',
  195 + components: {
  196 + AddCoupon
  197 + },
  198 + mixins: [activityMixin],
  199 + data() {
  200 + return {
  201 + formInline: new CouponQueryForm(),
  202 + isDataVisible: false, // 数据效果展示
  203 + dataInfo: [], // 商品使用数据
  204 + total: 1,
  205 + tableData: [],
  206 + dataEffect: []
  207 + }
  208 + },
  209 + mounted() {
  210 + this.getAll(this.formInline)
  211 + },
  212 + methods: {
  213 + closeModal() {
  214 + this.activityId = null
  215 + this.$refs.addCoupon.resetData()
  216 + },
  217 + // 查询
  218 + search() {
  219 + this.total = 1
  220 + this.formInline.page = 1
  221 + if (this.formInline.dates.length !== 0) {
  222 + this.formInline.startTime = this.formInline.dates[0]
  223 + this.formInline.endTime = this.formInline.dates[1]
  224 + }
  225 + this.getAll(this.formInline)
  226 + },
  227 + // 清除
  228 + clear() {
  229 + this.formInline = new CouponQueryForm()
  230 + this.getAll(this.formInline)
  231 + },
  232 + handleSizeChange(val) {
  233 + this.formInline.pageSize = val
  234 + this.getAll(this.formInline)
  235 + },
  236 + handleCurrentChange(val) {
  237 + this.formInline.page = val
  238 + this.getAll(this.formInline)
  239 + },
  240 + // 停止优惠券活动
  241 + stopFn(id) {
  242 + stopCoupon({ shopCouponId: id }).then(res => {
  243 + if (res.code === '') {
  244 + this.$message.success('停止成功')
  245 + this.formInline.page = 1
  246 + this.getAll(this.formInline)
  247 + } else {
  248 + this.$message.error(res.message)
  249 + }
  250 + })
  251 + },
  252 + // 初始化查询所有数据
  253 + async getAll(formInline) {
  254 + formInline.type = 1
  255 + const res = await getCoupon(formInline)
  256 + this.total = res.data.total
  257 + this.tableData = res.data.list
  258 + },
  259 + // 显示数据效果
  260 + showData(id) {
  261 + getCouponData({ shopCouponId: id }).then(res => {
  262 + if (res.code === '') {
  263 + this.dataInfo = res.data
  264 + } else {
  265 + this.$message.error(res.message)
  266 + }
  267 + })
  268 + this.isDataVisible = true
  269 + },
  270 + // 删除优惠券
  271 + delCouponFn(data) {
  272 + delCoupon({ shopCouponId: data.shopCouponId }).then(res => {
  273 + if (res.code === '') {
  274 + this.$message.success('删除成功')
  275 + this.formInline.page = 1
  276 + this.getAll(this.formInline)
  277 + } else {
  278 + this.$message.error(res.message)
  279 + }
  280 + })
  281 + }
  282 + }
  283 +}
  284 +</script>
  285 +
  286 +<style lang='scss' scoped>
  287 +//@import url(); 引入公共css类
  288 +@import url("../../../styles/elDialog.scss");
  289 +
  290 +.pending {
  291 + padding: 0 20px 20px 20px;
  292 + background-color:#fff;
  293 + min-height: calc(100vh - 50px - 20px);
  294 +}
  295 +.fenye {
  296 + margin-top: 20px;
  297 + display: flex;
  298 + justify-content: flex-end;
  299 + position: relative;
  300 +}
  301 +.dataEffect {
  302 + .couponTit {
  303 + margin: 20px 0;
  304 + }
  305 + .dataListBox {
  306 + display: flex;
  307 + justify-content: center;
  308 + margin: 30px 0;
  309 + .dataItem {
  310 + width: 220px;
  311 + height: 120px;
  312 + border-radius: 8px;
  313 + border: 1px solid #999999;
  314 + text-align: center;
  315 + margin: 0 10px;
  316 + span {
  317 + display: block;
  318 + margin-top: 35px;
  319 + }
  320 + }
  321 + }
  322 + .tabListInfo {
  323 + margin: 20px 0;
  324 + }
  325 +
  326 +}
  327 + .formSearch {
  328 + display: flex;
  329 + width: 100%;
  330 + font-size: 14px;
  331 + justify-content: space-between;
  332 + }
  333 + ::v-deep .el-pagination__total {
  334 + position: absolute;
  335 + left: 10px;
  336 + }
  337 +</style>
  338 +<style scoped>
  339 +.btnList /deep/ .delCls {
  340 + margin-left: 10px;
  341 +}
  342 +.group-dialog /deep/ .el-dialog__headerbtn .el-dialog__close {
  343 + color: #FFFFFF;
  344 +}
  345 + ::v-deep .el-input__inner:focus {
  346 + border: #11be59 1px solid;
  347 + }
  348 + ::v-deep .el-input__inner:hover {
  349 + border: #11be59 1px solid;
  350 + }
  351 + ::v-deep .el-select .el-input.is-focus .el-input__inner{
  352 + border-color:#11be59
  353 + }
  354 + ::v-deep .el-form-item__label{
  355 + font-weight: normal;
  356 + font-size: 14px;
  357 + }
  358 + ::v-deep .btn .el-button:focus,
  359 + .el-button:hover {
  360 + border: 1px solid #3F9B6A;
  361 + }
  362 + ::v-deep .el-button {
  363 + border: 1px solid #3F9B6A;
  364 + }
  365 + ::v-deep .el-pagination.is-background .el-pager li:not(.disabled).active {
  366 + background-color: #3F9B6A;
  367 + }
  368 + .el-radio__input.is-checked+.el-radio__label{
  369 + color:#3F9B6A;
  370 + }
  371 +
  372 +</style>
  373 +<style>
  374 + .el-select-dropdown__item.selected{
  375 + color: #3F9B6A;
  376 + }
  377 +</style>
... ...
merchant-web-master/src/views/marketing/coupon/index.vue
1 1 <template>
2   - <div style="padding: 0 10px;background-color:#f7f7f7;">
3   - <div class="pending">
  2 + <div style="padding: 0 10px;background: #fff;margin: 0 10px;">
  3 + <div v-if="activityVisible == '2'" style="padding-right: 20px;padding-bottom: 30px;">
  4 + <AddCoupon
  5 + ref="addCoupon"
  6 + :coupon-id="activityId"
  7 + @reset="reset"
  8 + />
  9 + </div>
  10 + <div class="pending" v-if="activityVisible == '1'">
4 11 <div class="formSearch">
5 12 <el-form :inline="true" :model="formInline" class="demo-form-inline">
6 13 <el-form-item label="优惠券名称">
... ... @@ -83,49 +90,25 @@
83 90 class="tableBtn greens">编辑</div>
84 91 <div v-if="scope.row.state !== 0" type="text" @click="showData(scope.row.shopCouponId)"
85 92 class="tableBtn greens">数据</div>
86   - <el-popconfirm v-if="scope.row.state === 0 || scope.row.state === 2" title="确定删除此券?" @onConfirm="delCouponFn(scope.row)">
87   - <div slot="reference" type="text"
88   - class="tableBtn greens">删除</div>
89   - </el-popconfirm>
90   - <el-popconfirm v-if="scope.row.state === 1" title="是否停止此活动?" @onConfirm="stopFn(scope.row.shopCouponId)">
91   - <div slot="reference" type="text"
  93 + <div @click="delCouponFn(scope.row)" v-if="scope.row.state === 0 || scope.row.state === 2" slot="reference" type="text" class="tableBtn greens">删除</div>
  94 + <div v-if="scope.row.state === 1" slot="reference" type="text" @click="stopFn(scope.row.shopCouponId)"
92 95 class="tableBtn greens">停止</div>
93   - </el-popconfirm>
94 96 </div>
95 97 </template>
96 98 </el-table-column>
97 99 </el-table>
98   - <div class="fenye">
99   - <el-pagination
100   - :current-page="formInline.page"
101   - :page-sizes="[10, 20, 50, 100]"
102   - :page-size="10"
103   - background
104   - small
105   - layout="prev, pager, next,total"
106   - :total="total"
107   - @size-change="handleSizeChange"
108   - @current-change="handleCurrentChange"
109   - />
110   - </div>
  100 +
  101 + <div style="display: flex;justify-content: space-between;margin-top: 30px;" class="bom">
  102 + <div style="font-size: 14px;">共 <span style="color: #3F9B6A;">{{total}}</span> 项数据</div>
  103 + <el-pagination :current-page="formInline.page" :page-sizes="[10, 20, 50, 100]" :page-size="10" background
  104 + small layout="prev, pager, next" :total="total" @size-change="handleSizeChange"
  105 + @current-change="handleCurrentChange">
  106 + </el-pagination>
  107 + </div>
111 108 </div>
112 109  
113 110 <!-- 新增活动 -->
114   - <el-dialog
115   - :title="activityId ? '修改优惠券' : '新增优惠券'"
116   - :visible.sync="activityVisible"
117   - width="55%"
118   - center
119   - custom-class="bian_css"
120   - :close-on-click-modal="false"
121   - @close="closeModal"
122   - >
123   - <AddCoupon
124   - ref="addCoupon"
125   - :coupon-id="activityId"
126   - @reset="reset"
127   - />
128   - </el-dialog>
  111 +
129 112 <!-- 数据展示 -->
130 113 <el-dialog
131 114 :close-on-click-modal="false"
... ... @@ -198,6 +181,7 @@ export default {
198 181 mixins: [activityMixin],
199 182 data() {
200 183 return {
  184 + type:'2',
201 185 formInline: new CouponQueryForm(),
202 186 isDataVisible: false, // 数据效果展示
203 187 dataInfo: [], // 商品使用数据
... ... @@ -239,15 +223,25 @@ export default {
239 223 },
240 224 // 停止优惠券活动
241 225 stopFn(id) {
242   - stopCoupon({ shopCouponId: id }).then(res => {
243   - if (res.code === '') {
244   - this.$message.success('停止成功')
245   - this.formInline.page = 1
246   - this.getAll(this.formInline)
247   - } else {
248   - this.$message.error(res.message)
249   - }
250   - })
  226 + let that = this
  227 + this.$confirm('是否将该优惠券停止?', '提示', {
  228 + confirmButtonText: '确定',
  229 + cancelButtonText: '取消',
  230 + type: 'warning'
  231 + }).then(() => {
  232 + console.error(id)
  233 + stopCoupon({ shopCouponId: id }).then(res => {
  234 + if (res.code === '') {
  235 + that.$message.success('停止成功')
  236 + that.formInline.page = 1
  237 + that.getAll(that.formInline)
  238 + } else {
  239 + that.$message.error(res.message)
  240 + }
  241 + })
  242 + }).catch(() => {
  243 +
  244 + });
251 245 },
252 246 // 初始化查询所有数据
253 247 async getAll(formInline) {
... ... @@ -269,15 +263,24 @@ export default {
269 263 },
270 264 // 删除优惠券
271 265 delCouponFn(data) {
272   - delCoupon({ shopCouponId: data.shopCouponId }).then(res => {
  266 + let that = this
  267 + this.$confirm('是否将该优惠券删除?', '提示', {
  268 + confirmButtonText: '确定',
  269 + cancelButtonText: '取消',
  270 + type: 'warning'
  271 + }).then(() => {
  272 + delCoupon({ shopCouponId: data.shopCouponId }).then(res => {
273 273 if (res.code === '') {
274   - this.$message.success('删除成功')
275   - this.formInline.page = 1
276   - this.getAll(this.formInline)
  274 + that.$message.success('删除成功')
  275 + that.formInline.page = 1
  276 + that.getAll(that.formInline)
277 277 } else {
278   - this.$message.error(res.message)
  278 + that.$message.error(res.message)
279 279 }
280 280 })
  281 + }).catch(() => {
  282 +
  283 + });
281 284 }
282 285 }
283 286 }
... ... @@ -290,7 +293,7 @@ export default {
290 293 .pending {
291 294 padding: 0 20px 20px 20px;
292 295 background-color:#fff;
293   - min-height: calc(100vh - 50px - 20px);
  296 +// min-height: calc(100vh - 50px - 20px);
294 297 }
295 298 .fenye {
296 299 margin-top: 20px;
... ...
merchant-web-master/src/views/marketing/mixin/index.js
1 1 export default {
2 2 data() {
3 3 return {
4   - activityVisible: false,
  4 + activityVisible: '1',
5 5 activityId: 0
6 6 }
7 7 },
8 8 methods: {
9 9 addActivity() {
10 10 this.activityId = 0
11   - this.activityVisible = true
  11 + this.activityVisible = '2'
12 12 },
13 13 editActivity(id) {
14 14 this.activityId = id
... ... @@ -18,7 +18,7 @@ export default {
18 18 }
19 19 },
20 20 reset() {
21   - this.activityVisible = false
  21 + this.activityVisible = '1'
22 22 this.getAll(this.formInline)
23 23 }
24 24 }
... ...