32172fb1 by 杨炀

no message

1 parent 5bd03939
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
4 4
5 // staging 5 // staging
6 // const baseUrl_api = "http://22yidpjzjifv.ngrok.xiaomiqiu123.top/stage-api/"; 6 // const baseUrl_api = "http://22yidpjzjifv.ngrok.xiaomiqiu123.top/stage-api/";
7 const baseUrl_api = "http://192.168.1.11:8787"; 7 const baseUrl_api = "http://182.92.233.247/stage-api/";
8 8
9 export default { 9 export default {
10 baseUrl_api 10 baseUrl_api
......
...@@ -38,7 +38,8 @@ ...@@ -38,7 +38,8 @@
38 "quickapp" : {}, 38 "quickapp" : {},
39 /* 小程序特有相关 */ 39 /* 小程序特有相关 */
40 "mp-weixin" : { 40 "mp-weixin" : {
41 "appid" : "wx5d51e8ed31bbdbb7",//J系统 41 "appid" : "wx5d51e8ed31bbdbb7", //J系统
42
42 // "appid" : "wx70f16625f10de4fe",//新跆联 43 // "appid" : "wx70f16625f10de4fe",//新跆联
43 // "appid" : "wx5e2471ed6210c3a6", 44 // "appid" : "wx5e2471ed6210c3a6",
44 "setting" : { 45 "setting" : {
...@@ -48,7 +49,9 @@ ...@@ -48,7 +49,9 @@
48 }, 49 },
49 "usingComponents" : true, 50 "usingComponents" : true,
50 "permission" : {}, 51 "permission" : {},
51 "optimization":{"subPackages":true} 52 "optimization" : {
53 "subPackages" : true
54 }
52 }, 55 },
53 "mp-alipay" : { 56 "mp-alipay" : {
54 "usingComponents" : true 57 "usingComponents" : true
......
1 <template> 1 <template>
2 <view class="graybg">
3 <view v-if="formData.type=='0'">
4 <view v-html="formData.content" class="richContent"></view>
5 </view>
6 <view v-if="formData.type=='1'" class="formBox">
7 <view @click="clickImg">
8 <image style="width: 100%;height: 50vw;" mode="aspectFit" v-for="p in formData.picArr" :src="p"/>
9 </view>
10 2
11 <view v-if="formData.content2" v-html="formData.content2" class="richContent2"></view>
12
13 <uni-forms ref="baseForm" :modelValue="baseFormData">
14 <uni-forms-item label="姓名" required v-if="formData.fields.indexOf('0')>-1">
15 <uni-easyinput v-model="baseFormData.name" placeholder="请输入姓名" />
16 </uni-forms-item>
17 <uni-forms-item label="手机号" required v-if="formData.fields.indexOf('1')>-1">
18 <uni-easyinput v-model="baseFormData.telno" placeholder="请输入手机号" />
19 </uni-forms-item>
20 <uni-forms-item label="需求描述" required v-if="formData.fields.indexOf('2')>-1">
21 <uni-easyinput type="textarea" v-model="baseFormData.requirement" placeholder="请输入需求描述" />
22 </uni-forms-item>
23 </uni-forms>
24 <button type="primary" @click="submit">提交</button>
25 </view>
26 </view>
27
28 <uni-popup ref="alertPayOk" type="dialog">
29 <uni-popup-dialog type="success" confirmText="返回主页" content="提交成功" @confirm="goIndex">
30 </uni-popup-dialog>
31 </uni-popup>
32 </template> 3 </template>
33 4
34 <script setup> 5 <script setup>
...@@ -42,85 +13,7 @@ ...@@ -42,85 +13,7 @@
42 import * as api from '@/common/api.js'; 13 import * as api from '@/common/api.js';
43 const { proxy } = getCurrentInstance() 14 const { proxy } = getCurrentInstance()
44 const app = getApp(); 15 const app = getApp();
45 const telNo = ref('');
46 const alertPayOk = ref(null);
47 const isActive = ref(null);
48 const formData = ref({})
49 const baseFormData = ref({})
50 const rules= ref({
51 name: {rules: [{required: true,errorMessage: '请输入姓名'}]},
52 telno: {rules: [{required: true,errorMessage: '请输入手机号'}]},
53 requirement: {rules: [{required: true,errorMessage: '请输入需求描述'}]},
54 })
55
56 onReady(()=>{
57 // 修改页头标题
58 uni.setNavigationBarTitle({
59 title: formData.value.name
60 });
61 })
62 onShow(() => {
63 formData.value = JSON.parse(app.globalData.venue.miniappCustConfig)
64 formData.value.picArr = formData.value.pics.split(',')
65 });
66
67 function goIndex() {
68 uni.redirectTo({
69 url: `/pages/index/index`
70 })
71 }
72 function submit(){
73 // 姓名
74 if((formData.value.fields.indexOf('0')>-1) && baseFormData.value.name==undefined){
75 uni.showToast({
76 title: '请输入姓名',
77 icon: 'none',
78 duration: 2000
79 });
80 return
81 }
82 // 手机号
83 if(formData.value.fields.indexOf('1')>-1&&baseFormData.value.telno==undefined){
84 uni.showToast({
85 title: '请输入手机号',
86 icon: 'none',
87 duration: 2000
88 });
89 return
90 }
91 // 需求描述
92 if(formData.value.fields.indexOf('2')>-1&&baseFormData.value.requirement==undefined){
93 uni.showToast({
94 title: '请输入需求描述',
95 icon: 'none',
96 duration: 2000
97 });
98 return
99 }
100
101
102
103 api.miniappData(baseFormData.value).then((res)=>{
104 baseFormData.value = []
105 alertPayOk.value.open()
106 })
107 16
108 }
109 function clickImg() {
110 uni.previewImage({
111 urls: formData.value.picArr,
112 // current: 0,
113 success: function(res) {
114 console.log('success', res)
115 },
116 fail: function(res) {
117 console.log('fail', res)
118 },
119 complete: function(res) {
120 console.log('complete', res)
121 }
122 })
123 }
124 </script> 17 </script>
125 18
126 <style scoped> 19 <style scoped>
......
1 <template> 1 <template>
2 <view class="graybg">
3 <view class="pads">
4 <view class="box">
5 <view class="billItem" @click="showDetail(b)" v-for="b in billsList" :key="b.id">
6 <!-- parentType -->
7 <view> 2 <view>
8 订单编号:
9 <text>{{ b.orderCode }}</text>
10 </view>
11 <view v-if="b.verificationCode">
12 验证码:
13 <text>{{ b.verificationCode }}</text>
14 </view>
15 <view v-if="b.siteName">
16 预订项目:
17 <text>{{b.projectName||b.sonList[0].projectName}} {{ b.siteName }}</text>
18 </view>
19 <view v-if="b.orderDate">
20 预订时间:
21 <text>{{ b.orderDate }} {{ b.orderTimePeriod.replace(/,/,'-') }}</text>
22 </view>
23 <view class="billFoot">
24 <view class="status" v-if="b.payStatus == 1">{{ b.payStatusStr }}</view>
25 <view class="status warning" v-else>{{ b.payStatusStr }}</view>
26 <view class="price">
27 <text class="tip" v-if="b.payStatus == 0 && b.parentType == 2">*子订单不支持独立支付</text>
28 <!--payStatus 0 未支付 1 已支付 2 部分退款 3 已退款-->
29 <!--orderType 预定类型 0 普通预定 1 长租预定 2 预留 3 锁场 -->
30 3
31 <text v-if="b.payStatus==0">原价¥{{b.orderAmount}}</text>
32 <text v-if="b.payStatus>0">{{b.finalOrderAmount}}</text>
33 <text class="danger" v-if="b.payStatus==2||b.payStatus==3">
34 (已退款¥{{b.refundAmount}})</text>
35
36
37 <button class="billbtn" v-if="b.payStatusStr == '未支付' && b.parentType != 2" @click.stop="goBooking(b)">去支付</button>
38 </view>
39 </view>
40 </view>
41
42 <view v-show="isLoadMore" @click="clickLoadMore">
43 <uni-load-more :status="loadStatus" :content-text="contentText"></uni-load-more>
44 </view>
45 <view class="nodata" v-if="billsList.length==0">
46 <image mode="aspectFit" src="/static/nodata.png"></image>
47 </view>
48 </view>
49 </view>
50 </view> 4 </view>
51 </template> 5 </template>
52 6
53 <script setup>
54 import { ref } from 'vue';
55 import { onShow,onPullDownRefresh,onReachBottom} from '@dcloudio/uni-app';
56 import * as api from '@/common/api.js';
57 import _ from 'lodash';
58 const billsList = ref([]);
59 const alertDialog = ref(null);
60 const isLoadMore = ref(false);
61 const loadStatus = ref('loading');
62 const contentText = ref({
63 contentdown: '点击查看更多',
64 contentrefresh: '正在加载...',
65 contentnomore: '没有更多数据了'
66 })
67 const queryparam = ref({
68 pageNum:1,
69 pageSize: 10
70 })
71 onShow(() => {
72 billsList.value = []
73 getBills()
74 });
75 function clickLoadMore() {
76 if(loadStatus.value=='nomore'){
77 return
78 }
79 queryparam.value.pageNum+=1
80 getBills()
81
82 }
83 function getBills() {
84 isLoadMore.value = false
85 api.getMalist(queryparam.value).then(res => {
86 _.each(res.rows,(r)=>{
87 billsList.value.push(r)
88 })
89 // billsList.value = res.rows;
90 if(res.total < (queryparam.value.pageSize*queryparam.value.pageNum)){
91 isLoadMore.value = true
92 loadStatus.value='nomore'
93 } else {
94 isLoadMore.value = true
95 loadStatus.value='more'
96 }
97 });
98 }
99 function goBooking(b) {
100 let path = `/pages/index/booking?id=${b.id}`;
101 uni.navigateTo({
102 url: path
103 });
104 }
105 function showDetail(b) {
106 let path = `/pages/usercenter/billsDetail?id=${b.id}`;
107 uni.navigateTo({
108 url: path
109 });
110 }
111 function pay() {
112 alertDialog.value.open();
113 }
114 function dialogConfirm() {
115 // 微信支付
116 }
117 function dialogClose() {
118 alertDialog.value.close();
119 }
120 </script>
121 7
122 <style lang="scss" scoped>
123 .pads{padding:0 25rpx 70rpx;}
124 .billItem {
125 width: auto; padding-bottom: 1px;
126 .uni-input {
127 padding: 15rpx 0;
128 color: #000;
129 }
130 .billFoot{ margin-bottom: 20rpx;}
131 }
132 .rrcard .box {
133 padding: 0 0 1px;
134 margin: 20rpx 0 0;
135 }
136 .graybg {
137 background: #f7f8fa;
138 height: 100vh;
139 width: 100vw;
140 overflow: auto;
141 }
142 .whitebg {
143 background: #fff;
144 margin-top: 15rpx;
145 border-radius: 20rpx;
146 margin-bottom: 180rpx;
147 }
148 .payBtn {
149 width: 750rpx;
150 line-height: 90rpx;
151 height: 120rpx;
152 text-align: center;
153 background: #ff8124;
154 color: #ffffff;
155 font-size: 36rpx;
156 border-radius: 20rpx 20rpx 0px 0px;
157 position: fixed;
158 bottom: 0;
159 }
160 .uni-list-cell::after {
161 display: none;
162 }
163 .littleimgBox {
164 display: flex;
165 align-items: center;
166 }
167 .littleimg {
168 width: 50rpx;
169 height: 50rpx;
170 margin-right: 15rpx;
171 }
172 .padh20 {
173 padding: 0 25rpx;
174 }
175 .billFoot .tip {
176 font-size: 24rpx;
177 font-size: 24rpx;
178 color: #999;
179 font-weight: 500;
180 margin: 0 20rpx;
181 }
182 .billFoot text{white-space: nowrap;}
183 .billFoot text.danger{color: #da2a2a;}
184 </style>
......
1 <template> 1 <template>
2 <view class="graybg">
3 <view class="padh20">
4 <view class="box">
5 <view class="billItem">
6 <view>订单编号: <text>{{bill.orderCode||bill.id}}</text></view>
7 <view v-if="bill.verificationCode">验证码: <text>{{bill.verificationCode}}</text></view>
8 <view v-if="bill.siteName">预订项目: <text>{{bill.projectName}} {{bill.siteName}}</text></view>
9 <view v-if="bill.orderDate">预订时间: <text>{{bill.orderDate}} {{bill.orderTimePeriod.replace(/,/,'-')}}</text></view>
10 <view class="billCode" v-if="bill.qrCodeBase&&bill.payStatus==1">
11 <!-- -->
12 <image class="codeChecked" src="@/static/done.png" v-if="bill.status=='2'"/>
13 <image :src="bill.qrCodeBase"></image>
14 </view>
15 2
16 <view v-if="bill.payStatus==0">
17 下单时间:
18 <text>{{bill.payTime}}</text>
19 </view>
20 <view v-if="bill.payStatus!=0">
21 支付时间:
22 <text>{{bill.payTime}}</text>
23 </view>
24 <view>
25 订单状态:
26 <text>{{bill.payStatusStr}}</text>
27 </view>
28 <view v-if="bill.remark">
29 备注: <text>{{bill.remark}}</text>
30 </view>
31 <view v-if="bill.payStatus==0">
32 原价: <text class="price">{{bill.unuseBalancePrice}}</text>
33 </view>
34
35 <view v-if="bill.payStatus==0">
36 会员价: <text class="price">{{bill.useBalancePrice}}</text>
37 </view>
38 <view v-if="bill.payStatus>0">
39 支付金额: <text class="price">{{bill.finalOrderAmount}}</text>
40 </view>
41 <view v-if="bill.payStatus==3">
42 退款金额: <text class="price">{{bill.refundAmount}}</text>
43 </view>
44 <view class="billFoot" v-if="bill.sonList==null">
45 <!-- 2 用了 1 没用-->
46 <view class="status textherf" @click="payCancel(bill)"
47 v-if="!(bill.payStatus==0&&bill.parentType==2)&&bill.status==1">取消订单</view>
48 <!-- 0 未支付 1 已支付 2 部分退款 3 已退款-->
49 <view class="status" v-else-if="bill.payStatus==1">支付完成</view>
50 <view class="status warning" v-else>{{bill.payStatusStr}}</view>
51
52 <view class="price">
53 <text v-if="bill.payStatus==3||bill.payStatus==2">已退款¥{{bill.refundAmount}}</text>
54 <text v-else-if="bill.payStatus==1">{{bill.finalOrderAmount}}</text>
55 <button class="billbtn" v-if="bill.payStatusStr == '未支付'&&bill.parentType!=2"
56 @click="goBooking(bill)">去支付</button>
57 </view>
58 </view>
59 </view>
60
61 <view class="collapseBox" v-if="bill.sonList&&bill.sonList.length>0">
62 <uni-collapse @change="changeCollapse">
63 <uni-collapse-item :show-animation="true" v-for="z in bill.sonList" :key="z.id">
64 <template v-slot:title>
65 <text class="bold">{{z.projectName}}</text> <text class="ddd">({{z.siteName}})</text> <text class="ccc">{{z.orderDate.substring(5,10)}} {{z.orderTimePeriod.replace(/,/,'-')}}</text>
66 </template>
67 <view class="collapseBody">
68 <view class="pp">
69 子订单编号: <text>{{z.orderCode}}</text>
70 </view>
71 <view class="pp">
72 子订单金额: <text>¥{{z.orderAmount}}</text>
73 </view>
74 <view class="pp">
75 场地: <text>{{z.siteName}}</text>
76 </view>
77 <view class="pp">
78 预订时间: <text>{{z.orderDate}} {{z.orderTimePeriod.replace(/,/,'-')}}</text>
79 </view>
80
81 <view class="pp" v-if="z.verificationCode">
82 验证码: <text>【{{z.verificationCode}}】 </text>
83 </view>
84 <view class="billCode" v-if="z.qrCodeBase&&z.payStatus==1">
85 <image :src="z.qrCodeBase"></image>
86 </view>
87 <view class="pp" v-if="z.payStatus>0">
88 支付金额: <text>¥{{z.finalOrderAmount}}</text>
89 </view>
90 <view class="pp" v-if="z.payStatus==3&&z.refundAmount">
91 退款金额: <text>¥{{z.refundAmount}}</text>
92 </view>
93 <view class="pp" v-if="z.payStatus==0">
94 原价: <text class="price">¥{{z.unuseBalancePrice}}</text>
95 </view>
96
97 <view class="pp" v-if="z.payStatus==0">
98 会员价: <text class="price">¥{{z.useBalancePrice}}</text>
99 </view>
100
101 <view class="billFoot">
102 <!-- 2 用了 1 没用-->
103 <view class="status textherf" @click="payCancel(z)"
104 v-if="!(z.payStatus==0&&z.parentType==2)&&z.status==1">取消订单</view>
105 <!-- 0 未支付 1 已支付 2 部分退款 3 已退款-->
106 <view class="status" v-else-if="z.payStatus==1">支付完成</view>
107 <view class="status warning" v-else>{{z.payStatusStr}}</view>
108
109 <!-- <view class="price" v-if="z.payStatus!=3">¥{{z.finalOrderAmount}}</view> -->
110 <!-- 退款金额 -->
111 <!-- <view class="price" v-else>¥{{z.refundAmount}}</view> -->
112 </view>
113 </view>
114 </uni-collapse-item>
115 </uni-collapse>
116 </view>
117
118 <view v-if="bill.sonList&&bill.sonList.length>0" class="fixedBBB">
119 <view class="billFoot">
120 <!-- 2 用了 1 没用-->
121 <view class="status textherf" @click="payCancel(bill)" v-if="bill.status==1">
122 <text v-if="bill.payStatus==0">批量取消</text>
123 <text v-else>批量退订</text>
124 </view>
125 <!-- 0 未支付 1 已支付 2 部分退款 3 已退款-->
126 <view class="status" v-else-if="bill.payStatus==1">支付完成</view>
127 <view class="status warning" v-else>{{bill.payStatusStr}}</view>
128
129 <view class="price">
130 <text v-if="bill.payStatus==0">原价¥{{bill.orderAmount}}</text>
131 <text v-if="bill.payStatus>0">¥{{bill.finalOrderAmount}}</text>
132 <text class="danger" v-if="bill.payStatus==2||bill.payStatus==3">
133 (已退款¥{{bill.refundAmount}})</text>
134
135 <button class="billbtn" v-if="bill.payStatusStr == '未支付'&&bill.parentType!=2"
136 @click="goBooking(bill)">去支付</button>
137 </view>
138 </view>
139 </view>
140 </view>
141 </view>
142
143 </view>
144 </template> 3 </template>
145 4
146 <script setup> 5 <script setup>
...@@ -150,258 +9,17 @@ ...@@ -150,258 +9,17 @@
150 getCurrentInstance 9 getCurrentInstance
151 } from 'vue'; 10 } from 'vue';
152 import { 11 import {
153 onLoad, 12 onLoad
154 onBackPress,onPullDownRefresh
155 } from '@dcloudio/uni-app' 13 } from '@dcloudio/uni-app'
156 const { 14 const {
157 proxy 15 proxy
158 } = getCurrentInstance() 16 } = getCurrentInstance()
159 const bill = ref({})
160 const billId = ref()
161 const accordionVal = ref(1)
162 17
163 onLoad((options) => { 18 onLoad((options) => {
164 // 获取订单详情
165 console.log(options.id)
166 billId.value = options.id
167 getBill()
168 })
169 onPullDownRefresh(()=>{
170 getBill()
171 })
172
173 function payCancel(item) {
174 if (item.payStatus == 1) {
175 // 已付款
176 api.getCancelHint(item.orderCode).then(res => {
177 if (res.data.canCancel == 1&&res.data.refundPercent!=100) {
178 let hour = Math.floor(res.data.timeMinutes / 60)
179 let minute = res.data.timeMinutes % 60
180 let msg
181
182 if (hour > 0) {
183 msg = `距离开场还有${hour}小时 ${minute}分钟,将扣款${100 - res.data.refundPercent}%,你确定要退订吗?`
184 } else {
185 msg = `距离开场还有${minute}分钟,将扣款${100 - res.data.refundPercent}%,你确定要退订吗?`
186 }
187 19
188 uni.showModal({
189 title: '温馨提示',
190 content: msg,
191 success: function(res) {
192 if (res.confirm) {
193 cancelThisOrder(item.orderCode)
194 } else if (res.cancel) {
195 console.log('取消');
196 }
197 }
198 });
199 } else if(res.data.canCancel == 0) {
200 uni.showModal({
201 title: '温馨提示',
202 content: `此订单不可退订,如需退订请联系商家`,
203 showCancel: false,
204 success: function(res) {
205 if (res.confirm) {
206 console.log('确定');
207 } else if (res.cancel) {
208 console.log('取消');
209 }
210 }
211 });
212 } else {
213 uni.showModal({
214 title: '提示',
215 content: '确定取消订单吗?',
216 success: function(res) {
217 if (res.confirm) {
218 cancelThisOrder(item.orderCode)
219 } else if (res.cancel) {
220 console.log('取消');
221 }
222 }
223 });
224 }
225 }) 20 })
226
227 } else {
228 uni.showModal({
229 title: '提示',
230 content: '确定取消订单吗?',
231 success: function(res) {
232 if (res.confirm) {
233 cancelThisOrder(item.orderCode)
234 } else if (res.cancel) {
235 console.log('取消');
236 }
237 }
238 });
239 }
240
241 }
242
243 function cancelThisOrder(id) {
244 api.cancelOrder(id).then((res) => {
245 uni.showToast({
246 title: res.msg,
247 icon: 'none'
248 });
249 getBill()
250 })
251 }
252
253 function getBill() {
254 api.getMaItemById(billId.value).then(res => {
255 bill.value = res.data
256 })
257 }
258
259 function goBooking(b) {
260 let path = `/pages/index/booking?id=${b.id}`;
261 uni.redirectTo({
262 url: path
263 });
264 }
265
266 function changeCollapse(e) {
267 console.log(e);
268 }
269 </script> 21 </script>
270 22
271 <style lang="scss" scoped> 23 <style lang="scss" scoped>
272 .collapseBox {
273 margin-top: 30rpx;
274 }
275
276 .billItem {
277 width: auto;
278 padding-bottom: 1px;
279
280 .uni-input {
281 padding: 15rpx 0;
282 color: #000;
283 }
284 }
285
286 .rrcard .box {
287 padding: 0 0 1px;
288 margin: 20rpx 0 0;
289 }
290
291 .graybg {
292 background: #f7f8fa;
293 padding: 0 0 140rpx;
294 height: 100vh;
295 width: 100vw;
296 overflow: auto;
297 }
298
299 .whitebg {
300 background: #fff;
301 margin-top: 15rpx;
302 border-radius: 20rpx;
303 margin-bottom: 180rpx;
304 }
305
306 .uni-list-cell::after {
307 display: none;
308 }
309
310 .padh20 {
311 padding: 0 25rpx;
312 }
313
314 .billItem .billCode {
315 position: relative;
316 border-top: 1rpx dashed #E5E5E5;
317 }
318
319 .collapseBody {
320 margin: 20rpx 0 0;
321 }
322
323 .collapseBody .billCode {
324 position: relative;
325 border-top: 1rpx dashed #E5E5E5;
326 }
327
328 .billItem .billCode image {
329 width: 340rpx;
330 height: 340rpx;
331 margin: 30rpx auto;
332 display: block;
333 }
334
335 .collapseBody .billCode image {
336 width: 340rpx;
337 height: 340rpx;
338 margin: 30rpx auto;
339 display: block;
340 }
341
342 .billFoot .status.textherf {
343 color: #888;
344 font-size: 28rpx;
345 text-decoration: underline;
346 }
347
348 .collapseBody .billFoot {
349 margin: 20rpx 0 0;
350 padding: 22rpx 0;
351 }
352
353 .billSon {
354 padding: 0 35rpx;
355 border-top: 1px dashed #e1e1e1;
356 border-bottom: 1px dashed #e1e1e1;
357 }
358
359 .billItem .billSonItem {}
360
361 .billSonItem .pp {
362 padding: 15rpx 0;
363 overflow: hidden;
364 }
365
366 .collapseBody .pp {
367 padding: 15rpx 0;
368 overflow: hidden;
369 }
370
371 .billSonItem .pp text {
372 float: right;
373 }
374
375 .collapseBody .pp text {
376 float: right;
377 }
378
379 .billItem .ttt {
380 font-size: 28rpx;
381 padding: 0 35rpx;
382 color: #000;
383 }
384
385 .fixedBBB {
386 background: #fff;
387 width: 100%;
388 position: fixed;
389 height: 120rpx;
390 bottom: 0;
391 left: 0;
392 }
393 24
394 .codeChecked {
395 position: absolute;
396 width: 200rpx;
397 height: 130rpx;
398 right: 15%;
399 top: 30%;
400 }
401 .billItem view text.price{ color: #ff8124;font-weight:bold;}
402 .bold{font-weight:500;font-size:28rpx;}
403 .ccc{color:#666;font-size:28rpx;}
404 .ddd{color:#666;font-size:28rpx;margin: 0 10rpx;}
405 .billFoot text.danger{color: #da2a2a;}
406 .billItem view text{white-space: nowrap;}
407 </style> 25 </style>
......
1 <template> 1 <template>
2 <view class="fixedbody">
3 <uni-forms ref="baseForm" :modelValue="baseFormData" :rules="rules" label-width="80">
4 <uni-group mode="card" title="个人信息" top="20">
5 <view class="wBox">
6 <uni-forms-item label="照片" required name="picUrl">
7 <view class="avatarUrl">
8 <button type="balanced" open-type="chooseAvatar" @chooseavatar="onChooseavatar">
9 <image mode="aspectFill" :src="baseFormData.picUrl" class="refreshIcon"></image>
10 </button>
11 </view>
12 </uni-forms-item>
13 <uni-forms-item label="姓名" required name="realName">
14 <uni-easyinput v-model="baseFormData.realName" placeholder="请输入姓名" />
15 </uni-forms-item>
16 2
17 <!--<uni-forms-item label="身份标签" required>
18 <uni-data-checkbox v-model="baseFormData.label" multiple :localdata="tagList" />
19 </uni-forms-item>-->
20 <uni-forms-item label="证件类型" required name="idcType">
21 <uni-data-select
22 v-model="baseFormData.idcType"
23 :localdata="idcTypeList"
24 @change="changeidcType"
25 ></uni-data-select>
26 </uni-forms-item>
27 <uni-forms-item label="证件号码" required name="idcCode">
28 <uni-easyinput v-model="baseFormData.idcCode" @blur="giveBirthDay" />
29 </uni-forms-item>
30 <uni-forms-item label="性别" required name="sex">
31 <uni-data-checkbox v-model="baseFormData.sex" @change="changeSex" :localdata="sexs" />
32 </uni-forms-item>
33 <uni-forms-item label="出生日期" required name="birth">
34 <uni-datetime-picker type="date" :clear-icon="false" v-model="baseFormData.birth" @maskClick="maskClick" />
35 </uni-forms-item>
36 <uni-forms-item label="联系方式" name="phone">
37 <uni-easyinput v-model="baseFormData.phone" placeholder="请输入联系方式" />
38 </uni-forms-item>
39 <uni-forms-item label="国籍" required name="countryId">
40 <uni-data-select
41 v-model="baseFormData.countryId"
42 :localdata="countryList"
43 @change="changeCountry"
44 ></uni-data-select>
45 </uni-forms-item>
46 <uni-forms-item label="民族" required name="nation">
47 <uni-data-select v-model="baseFormData.nation" :localdata="nationList"></uni-data-select>
48 </uni-forms-item>
49 <uni-forms-item label="所在地区">
50 <uni-data-picker class="fixUniFormItemStyle"
51 v-model="baseFormData.regionId"
52 :localdata="regionsList"
53 popup-title="请选择所在地区"
54 ></uni-data-picker>
55 </uni-forms-item>
56 <uni-forms-item label="详细地址"><uni-easyinput v-model="baseFormData.address" placeholder="请输入详细地址" /></uni-forms-item>
57
58 <uni-forms-item label="紧急联系人"><uni-easyinput v-model="baseFormData.ecName" placeholder="请输入联系人" /></uni-forms-item>
59 <uni-forms-item label="紧急联系方式"><uni-easyinput v-model="baseFormData.ecPhone" type="number" placeholder="请输入联系方式" /></uni-forms-item>
60 <uni-forms-item label="与本人关系"><uni-easyinput v-model="baseFormData.ecRelationship" placeholder="请输入与本人关系" /></uni-forms-item>
61
62 <view class="gapTitle" style="padding: 0; margin: 0 0 10rpx;">
63 实名认证
64 <text>正面为国徽面 反面为头像面</text>
65 </view>
66
67 <view class="ttt">
68 头像面<text>请拍摄完整身份证</text>
69 </view>
70 <view class="idImgUrl">
71 <uni-file-picker v-model="baseFormData.idcFrontImgObj" @delete="delimgFont" return-type="object" limit="1" @select="upIdCardImgFront" :image-styles="imageStyles"></uni-file-picker>
72 </view>
73
74 <view class="ttt">
75 国徽面<text>请拍摄完整身份证</text>
76 </view>
77 <view class="idImgUrl">
78 <uni-file-picker limit="1" v-model="baseFormData.idcBackImgObj" @delete="delimgBack" return-type="object" @select="upIdCardImgBack" :image-styles="imageStyles"></uni-file-picker>
79 </view>
80
81
82 </view>
83 </uni-group>
84
85 <uni-group mode="card" title="所属团体信息" top="20">
86 <view class="wBox">
87 <!-- <button class="poKxBtn" type="primary" plain="true">+加入机构</button> -->
88 <view class="matchItem" v-for="(g,index) in groupList" :key="index">
89 <view class="leftImg">
90 <image class="roundImg" :src="g.imgUrl" mode="aspectFill"></image>
91 </view>
92 <view class="rightWen">
93 <view class="name">{{g.name}}</view>
94 <view class="pp">地区:
95 <uni-data-picker readonly v-if="g.regionId" :clear-icon='false'
96 v-model="g.regionId"
97 :localdata="regionsList"
98 ></uni-data-picker>
99 <text v-else>暂无</text>
100 </view>
101 <view class="pp">类型:
102 <text v-if="g.type==0">学校 </text>
103 <text v-if="g.type==1">场馆 </text>
104 <text v-if="g.type==2">俱乐部 </text>
105 <text v-if="g.type==3">机构 </text>
106 </view>
107 </view>
108 <view class="bottomFunc">
109 <view class="textButtom" @click="exitGroup(g)">退出参赛队</view>
110 </view>
111 </view>
112
113 <view class="nodata" v-if="groupList.length==0">
114 <image mode="aspectFit" src="/static/nodata.png"></image>
115 </view>
116 </view>
117 </uni-group>
118
119 <uni-group mode="card" title="人员管理" top="20" style="display: none;">
120 <view class="wBox">
121 <button class="poKxBtn" type="primary" plain="true" @click="goEditCoach(0,0)">+添加人员</button>
122 <uni-segmented-control :current="current" :values="kindList" @clickItem="onClickItem" styleType="button" activeColor="#39DBA7"></uni-segmented-control>
123 <view class="matchItem" v-for="p in memberList" :key="p.id">
124 <view class="leftImg">
125 <image class="roundImg" :src="p.picUrl" mode="aspectFill"></image>
126 </view>
127 <view class="rightWen">
128 <view class="name">{{p.realName}}
129 <view class="tag-view" v-for="(l,index) in p.labelArr" :key="index">
130 <uni-tag v-if="l == '2'" :inverted="true" text="领队" type="warning" />
131 <uni-tag :inverted="true" v-if="l == '1'" text="教练" type="primary" />
132 <uni-tag :inverted="true" v-if="l == '0'" text="运动员" type="success" />
133 <uni-tag :inverted="true" v-if="l == '3'" text="其他" type="error" />
134 </view>
135 </view>
136 <view class="pp">
137 证件类型:
138 <text v-if="p.idcType == 0">身份证</text>
139 <text v-else-if="p.idcType == 1">护照</text>
140 <text v-else>其他</text>
141 </view>
142 <view class="pp">证件号:{{p.idcCode}}</view>
143 <view class="pp">联系方式:{{p.phone}}</view>
144 </view>
145 <view class="bottomFunc">
146 <view class="textButtom" @click="goEditCoach(p.id, groupId)">编辑</view>
147 <text class="greenline">|</text>
148 <view class="textButtom" @click="del(p)">删除</view>
149 </view>
150 </view>
151 <view class="nodata" v-if="memberList.length==0">
152 <image mode="aspectFit" src="/static/nodata.png"></image>
153 </view>
154 </view>
155 </uni-group>
156
157 </uni-forms>
158 <view class="fixedBottom"><button class="btn btn1" @click="goNext" type="default">保存</button></view>
159 </view>
160 </template> 3 </template>
161 4
162 <script setup>
163 import { ref } from 'vue';
164 import { onLoad ,onShow,onPullDownRefresh} from '@dcloudio/uni-app'
165 import * as match from '@/common/match.js'
166 import { tagList, sexs , idcTypeList,nationList } from '@/static/js/data'
167 const baseFormData = ref({
168 countryId:240
169 });
170 const rules = ref({
171 realName:{
172 rules:[{required: true,errorMessage: '请填写真实姓名'}]
173 }
174 });
175 const imageStyles=ref({
176 width:'500rpx',
177 height:'300rpx',
178 border:{radius:'2px'}
179 });
180 const countryList = ref([]);
181 const regionsList = ref([]);
182 const groupList = ref([]);
183 const memberList = ref([]);
184 const current = ref(0);
185 const kindList = ref(['教练', '领队', '其他']);
186 onLoad(()=>{
187 getCountryList()
188 getRegionsList()
189 })
190 onShow(()=>{
191 getData()
192 })
193 onPullDownRefresh(() => {
194 getData()
195 })
196 function getCountryList(){
197 match.countryList().then(res => {
198 countryList.value = res.data
199 for(const c of countryList.value){
200 c.value = c.id
201 c.text =c.name
202 }
203 })
204 }
205 function getRegionsList() {
206 match.regionsList().then(res => {
207 regionsList.value = res.data
208 });
209 }
210 function getData(){
211 match.getMyPersonInfo().then(res => {
212 baseFormData.value = res.data
213 groupList.value = baseFormData.value.groups||[]
214 current.value = 0
215 memberList.value = baseFormData.value.coaches||[]
216 if(baseFormData.value.idcFrontImg){
217 baseFormData.value.idcFrontImgObj = {
218 name:"正面",
219 extname:"jpg",
220 url:baseFormData.value.idcFrontImg,
221 }
222 }
223 if(baseFormData.value.idcBackImg){
224 baseFormData.value.idcBackImgObj = {
225 name:"反面",
226 extname:"jpg",
227 url:baseFormData.value.idcBackImg,
228 }
229 }
230 getLabel(memberList.value);
231 })
232 }
233 function giveBirthDay(){
234 // 判断身份证正确性/赋值生日
235 if(baseFormData.value.idcType==0){
236 if(!(/(^\d{15}$)|(^\d{17}([0-9]|X)$)/.test(baseFormData.value.idcCode))){
237 uni.showToast({
238 title: '请输入正确的身份证号码',
239 duration: 2000,
240 icon: 'none'
241 })
242 } else {
243 let tmpStr = "";
244 if (baseFormData.value.idcCode.length == 15) {
245 tmpStr = baseFormData.value.idcCode.substring(6, 12);
246 tmpStr = "19" + tmpStr;
247 tmpStr = tmpStr.substring(0, 4) + "-" + tmpStr.substring(4, 6) + "-" + tmpStr.substring(6)
248
249 }else{
250 tmpStr = baseFormData.value.idcCode.substring(6, 14);
251 tmpStr = tmpStr.substring(0, 4) + "-" + tmpStr.substring(4, 6) + "-" + tmpStr.substring(6)
252
253 }
254
255 baseFormData.value.birth = tmpStr
256 const res = /^(\d{6})(\d{4})(\d{2})(\d{2})(\d{3})([0-9]|X)$/
257 if (baseFormData.value.idcCode && res.test(baseFormData.value.idcCode)) {
258 const genderCode = baseFormData.value.idcCode.charAt(16)
259 if (parseInt(genderCode) % 2 == 0) {
260 baseFormData.value.sex = '0'
261 } else {
262 baseFormData.value.sex = '1'
263 }
264 }
265 }
266 }
267 }
268 function goNext() {
269 // 验证手机号
270 // var pattern = /^1[345789]\d{9}$/;
271 // if (!pattern.test(baseFormData.value.phone)) {
272 // uni.showToast({
273 // title: '请输入正确的手机号',
274 // duration: 2000,
275 // icon: 'none'
276 // })
277 // return
278 // }
279 // 验证身份证号
280 if(baseFormData.value.idcType==0&&!(/(^\d{15}$)|(^\d{17}([0-9]|X)$)/.test(baseFormData.value.idcCode))){
281 uni.showToast({
282 title: '请输入正确的身份证号码',
283 duration: 2000,
284 icon: 'none'
285 })
286 return
287 }
288 if (baseFormData.value.nation == null) {
289 uni.showToast({
290 title: '请填写民族',
291 duration: 2000,
292 icon: 'none'
293 })
294 return
295 }
296 match.saveMyBaseInfo(baseFormData.value).then(res=>{
297 uni.showToast({
298 title: '保存成功',
299 duration: 2000
300 });
301 })
302 }
303 function onChooseavatar(e) {
304 match.uploadFile(e).then(data=>{
305 baseFormData.value.picUrl = data.data
306 })
307 }
308 function upIdCardImgFront(e) {
309 match.uploadImg(e).then(data => {
310 baseFormData.value.idcFrontImg = data.data;
311 });
312 }
313 function upIdCardImgBack(e) {
314 match.uploadImg(e).then(data => {
315 baseFormData.value.idcFrontImg = data.data;
316 });
317 }
318 function delimgFont(n){
319 baseFormData.value.idcFrontImg = '';
320 }
321 function delimgBack(n){
322 baseFormData.value.idcBackImg = '';
323 }
324 function getLabel(list) {
325 if (list.length > 0) {
326 for (const m of list) {
327 m.labelArr = m.label.split(',');
328 }
329 }
330 }
331 function onClickItem(e) {
332 console.log(current.value);
333 if (current.value != e.currentIndex) {
334 current.value = e.currentIndex;
335 switch (current.value) {
336 case 0: {
337 memberList.value = baseFormData.value.coaches;
338 getLabel(memberList.value);
339 break;
340 }
341 case 1: {
342 memberList.value = baseFormData.value.leaders;
343 getLabel(memberList.value);
344 break;
345 }
346 case 2: {
347 memberList.value = baseFormData.value.others;
348 getLabel(memberList.value);
349 break;
350 }
351 }
352 }
353 }
354 function maskClick(e){
355 console.log('maskClick事件:', e);
356 }
357 function changeSex(e){
358 console.log("性别:",e.detail.value)
359 }
360 function changeCountry(e){
361 console.log(e);
362 if (e!= 240) {
363 baseFormData.value.nation = '其他'
364 }
365 }
366 function changeidcType(e){
367 console.log("证件:",e)
368 if(e){
369 baseFormData.value.idcTypeStr = idcTypeList[e].text
370 }
371 }
372 function exitGroup(g){
373 uni.showModal({
374 title: '提示',
375 content: `确定退出${g.name}吗?`,
376 success: function (res) {
377 if (res.confirm) {
378 match.leaveGroup(g.id).then(response => {
379 uni.showToast({
380 title: '已退出',
381 duration: 2000
382 });
383 })
384 } else if (res.cancel) {
385 console.log('用户点击取消');
386 }
387 }
388 });
389 }
390 function goEditCoach(id, groupId) {
391 uni.navigateTo({
392 url: `/pages_match/match/add_coach?id=${id || 0}&groupId=${groupId || 0}`
393 });
394 }
395 function del(p){
396 uni.showModal({
397 title: '提示',
398 content: `确定删除${p.realName}吗?`,
399 success: function (res) {
400 if (res.confirm) {
401 match.delPerson(p.id).then(response => {
402 uni.showToast({
403 title: '已删除',
404 duration: 2000
405 });
406 getData()
407 })
408 } else if (res.cancel) {
409 console.log('用户点击取消');
410 }
411 }
412 });
413 }
414 </script>
415 5
416 <style scope lang="scss"> 6 <style scope lang="scss">
417 .wBox { position: relative; 7 .wBox { position: relative;
......
1 <template> 1 <template>
2 <view class="fixedbody">
3 <uni-group mode="card" title="我的参赛队" top="20">
4 <view class="wBox">
5 <button class="poKxBtn" type="primary" plain="true" @click="newGroup">+新建参赛队</button>
6 <view class="matchItem" v-for="(g,index) in dataList" :key="index">
7 <view class="leftImg">
8 <image :src="g.imgUrl" mode="aspectFill"></image>
9 </view>
10 <view class="rightWen">
11 <view class="name">{{g.name}}</view>
12 <view class="pp">地区:
13 {{g.regionStr}}
14 </view>
15 <view class="pp">类型:{{g.typeStr}}</view>
16 </view>
17 <view class="bottomFunc">
18 <view class="textButtom" @click="view(g)">查看</view>
19 <text class="greenline">|</text>
20 <view class="textButtom" @click="del(g)">删除</view>
21 </view>
22 </view>
23 <view class="nodata" v-if="dataList.length==0">
24 <image mode="aspectFit" src="/static/nodata.png"></image>
25 <text>还没有参赛队,点击新建参赛队立即创建吧~</text>
26 </view>
27 </view>
28 </uni-group>
29 2
30
31 </view>
32 </template> 3 </template>
33 4
34 <script setup>
35 import { ref } from 'vue';
36 import * as match from '@/common/match.js'
37 import { onShow } from '@dcloudio/uni-app'
38 const baseFormData = ref({});
39 const dataList = ref([]);
40 const memberList = ref([{id:1},{id:2}]);
41 const avatarUrl = ref('');
42 const kindList = ref(['全部','运动员','教练','领队','其他']);
43 const tagList = ref([{text: '运动员',value: 0},{text: '教练',value: 1},{text: '领队',value: 2},{text: '其他',value: 3},]);
44 const typeList = ref([{text: '学校',value: 0}, {text: '场馆',value: 1}, {text: '俱乐部',value: 2}, {text: '机构',value: 3}]);
45 const regionsList = ref([]);
46 const current = ref(0);
47 const editIng = ref(false);
48 const showEditForm = ref(false);
49 const query = ref({
50 type: 0
51 })
52
53 onShow(()=>{
54 getRegionsList()
55 getList()
56 })
57
58 function getList(){
59 match.getMyGroupList(query).then(res => {
60 dataList.value = res.data
61 })
62 }
63 function newGroup() {
64 uni.navigateTo({
65 url: `/pages/usercenter/teamInfo`
66 });
67 }
68 function getRegionsList(){
69 match.regionsList().then(res => {
70 regionsList.value = res.data
71 })
72 }
73 function onchange(){
74
75 }
76 function onnodeclick(){
77
78 }
79 function onClickItem(e){
80 console.log(current.value)
81 if (current.value != e.currentIndex) {
82 current.value = e.currentIndex;
83 }
84 }
85 function goNext() {
86 baseFormData.value.src = avatarUrl.value
87
88 }
89 function onChooseavatar(e) {
90 if(editIng.value){
91 match.uploadFile(e).then(data => {
92 avatarUrl.value = data.data
93 })
94 } else {
95 return
96 }
97
98 }
99 function editTeamInfo(){
100 editIng.value = true
101 }
102 function goChooseCoach(n){
103 uni.navigateTo({
104 url: `/pages_match/match/choose_coach?id=${n||0}`
105 });
106 }
107 function goEditCoach(n){
108 uni.navigateTo({
109 url: `/pages_match/match/add_coach?id=${n||0}`
110 });
111 }
112 function view(g){
113 uni.navigateTo({
114 url: `/pages/usercenter/teamInfo?groupId=${g.id}`
115 });
116 }
117 function del(g){
118 // 删除团
119 uni.showModal({
120 title: '提示',
121 content: '确定删除吗',
122 success: function (res) {
123 if (res.confirm) {
124 match.deleteMyGroup(g.id).then(res=>{
125 uni.showToast({
126 icon:'none',
127 title: res.msg
128 })
129 getList()
130 })
131 } else if (res.cancel) {
132 console.log('用户点击取消');
133 }
134 }
135 });
136 }
137 function saveMyteam() {
138 match.saveMyGroup(baseFormData.value).then(res=>{
139 uni.showToast({
140 title: '保存成功',
141 duration: 2000
142 });
143 editIng.value = false
144 })
145 }
146 </script>
147
148 <style scope lang="scss"> 5 <style scope lang="scss">
149 .wBox {position: relative;background: #ffffff;border-radius: 15px;box-sizing: border-box;} 6 .wBox {position: relative;background: #ffffff;border-radius: 15px;box-sizing: border-box;}
150 .avatarUrl{width: 200rpx;height:200rpx;} 7 .avatarUrl{width: 200rpx;height:200rpx;}
......
1 <template> 1 <template>
2 <view class="box">
3 <view class="topBg">
4 <image src="/static/bg.png" class="topbgimg"></image>
5 <!-- @click="auth" -->
6 <view class="userInfoBox">
7 <view class="headImg">
8 <button type="balanced" open-type="chooseAvatar" @chooseavatar="onChooseavatar">
9 <image mode="aspectFill" :src="avatarUrl"></image>
10 </button>
11 </view>
12 <view class="nameBox">
13 <!-- <input v-model="user.nickName" type="nickname"/> -->
14 {{ user.nickName }}
15 <view @click="changePhoneNumber">{{ user.phonenumber }}</view>
16 </view>
17 </view>
18 <!-- 会员卡 -->
19 <view class="vipBox" v-if="!isMaster && card.isVip">
20 <image class="fm" :src="vTypeImg"></image>
21 <image class="vv" src="/static/vip.png"></image>
22 <view class="poInfo" @click="goCard">
23 <view class="flexline">
24 <view class="typeStr">{{ card.info.cardTypeStr }}</view>
25 <view class="cardCode">{{ card.info.cardCode }}</view>
26 </view>
27 <view class="flexline mt40">
28 <view class="ye">
29 余额(元)
30 <text>{{ card.info.balance }}</text>
31 </view>
32 2
33 <view class="zk">
34 折扣
35 <view>
36 <text>{{ (100 - card.info.discountPercent) / 10 }}</text>
37
38 </view>
39 </view>
40 </view>
41 </view>
42
43 <view class="cardBottom">
44 <text>有效期至{{ card.info?.expirationTime }}</text>
45 <text class="renewBtn" @click="goRenew">立即续费</text>
46 </view>
47 </view>
48 </view>
49 <view class="rMainBox" v-if="!isMaster">
50 <uni-list :border="false" class="myList">
51 <uni-list-item :border="false" title="个人信息" showArrow :to="`./myInfo`">
52 <template v-slot:header>
53 <view class="slot-box">
54 <image class="slot-image" src="/static/user_icon03.png" mode="widthFix"></image>
55 </view>
56 </template>
57 </uni-list-item>
58 <uni-list-item :border="false" title="参赛队信息" showArrow :to="`./teamList`">
59 <template v-slot:header>
60 <view class="slot-box">
61 <image class="slot-image" src="/static/user_icon06.png" mode="widthFix"></image>
62 </view>
63 </template>
64 </uni-list-item>
65 <uni-list-item :border="false" title="会员充值" showArrow :to="`./mycard/renew`">
66 <template v-slot:header>
67 <view class="slot-box">
68 <image class="slot-image" src="/static/user_icon01.png" mode="widthFix"></image>
69 </view>
70 </template>
71 </uni-list-item>
72
73 <uni-list-item :border="false" title="场地订单" showArrow :to="`./bills`">
74 <template v-slot:header>
75 <view class="slot-box">
76 <image class="slot-image" src="/static/user_icon02.png" mode="widthFix"></image>
77 </view>
78 </template>
79 </uni-list-item>
80
81 <uni-list-item :border="false" title="我的培训" showArrow clickable @click="myTrain">
82 <template v-slot:header>
83 <view class="slot-box">
84 <image class="slot-image" src="/static/user_icon07.png" mode="widthFix"></image>
85 </view>
86 </template>
87 </uni-list-item>
88
89 <uni-list-item :border="false" title="我的赛事" showArrow :to="`./match`">
90 <template v-slot:header>
91 <view class="slot-box">
92 <image class="slot-image" src="/static/user_icon04.png" mode="widthFix"></image>
93 </view>
94 </template>
95 </uni-list-item>
96 </uni-list>
97 </view>
98
99 <!-- 场馆人员 -->
100 <view class="forAdmin" v-if="isMaster">
101 <!-- <view class="forAdmin"> -->
102 <view class="onlyCardBottom">
103 <image src="/static/xf_bg.png" class="bbg"></image>
104 <view class="cardBottom">
105 <text>有效期至{{ card.info?.expirationTime }}</text>
106 <text class="renewBtn" @click="goRenew">立即续费</text>
107 </view>
108 </view>
109
110 <view class="funcBar">
111 <!-- <view @click="goOrder"> -->
112 <view @click="goBills">
113 <image mode="aspectFit" src="/static/icon01.png"></image>
114 预订
115 </view>
116 <view @click="goVip">
117 <image mode="aspectFit" src="/static/icon02.png"></image>
118 会员
119 </view>
120 <view @click="goQcode">
121 <image mode="aspectFit" src="/static/icon03.png"></image>
122 核验
123 </view>
124 </view>
125 <view class="mt40">
126 <uni-list :border="false" class="myList">
127 <uni-list-item :border="false" title="个人信息" showArrow :to="`./myInfo`">
128 <template v-slot:header>
129 <view class="slot-box">
130 <image class="slot-image" src="/static/user_icon03.png" mode="widthFix"></image>
131 </view>
132 </template>
133 </uni-list-item>
134 <uni-list-item :border="false" title="团体信息" showArrow :to="`./teamList`">
135 <template v-slot:header>
136 <view class="slot-box">
137 <image class="slot-image" src="/static/user_icon06.png" mode="widthFix"></image>
138 </view>
139 </template>
140 </uni-list-item>
141
142 <uni-list-item :border="false" title="培训报名" showArrow clickable @click="myTrain">
143 <template v-slot:header>
144 <view class="slot-box">
145 <image class="slot-image" src="/static/user_icon07.png" mode="widthFix"></image>
146 </view>
147 </template>
148 </uni-list-item>
149
150 <uni-list-item :border="false" title="我的赛事" showArrow :to="`./match`">
151 <template v-slot:header>
152 <view class="slot-box">
153 <image class="slot-image" src="/static/user_icon04.png" mode="widthFix"></image>
154 </view>
155 </template>
156 </uni-list-item>
157 </uni-list>
158 </view>
159
160 <view class="reportItembox">
161 <view class="reportItem">
162 <view class="t">今日预订</view>
163 <view class="rbody">
164 <view>
165 <text>{{ reportData.bookCount }}</text>
166 订场
167 </view>
168 <view>
169 <text>{{ reportData.bookAmount }}</text>
170 金额
171 </view>
172 </view>
173 </view>
174 <view class="reportItem">
175 <view class="t">商品销售</view>
176 <view class="rbody">
177 <view>
178 <text>--</text>
179
180 </view>
181 <view>
182 <text>--</text>
183 金额
184 </view>
185 </view>
186 </view>
187
188 <view class="reportItem">
189 <view class="t">今日会员</view>
190 <view class="rbody">
191 <view>
192 <text>{{ reportData.memberCount }}</text>
193 新增
194 </view>
195 <view>
196 <text>{{ reportData.memberAmout }}</text>
197 金额
198 </view>
199 </view>
200 </view>
201 <view class="reportItem">
202 <view class="t">今日签到</view>
203 <view class="rbody">
204 <view>
205 <text>--</text>
206 人数
207 </view>
208 <view>
209 <text>--</text>
210 金额
211 </view>
212 </view>
213 </view>
214 </view>
215 </view>
216
217 <uni-popup ref="inputDialog" type="dialog">
218 <uni-popup-dialog ref="inputClose" mode="input" title="修改会员卡绑定手机号" @confirm="dialogInputConfirm">
219 <view class="changephonepop">
220 <view><input placeholder="请输入手机号" type="number" v-model="captchaPhonenumber" /></view>
221 <view class="ffff">
222 <input placeholder="输入验证码" type="number" v-model="captcha" />
223
224 <button v-if="canSend" @click="sendsms">发送验证码</button>
225 <button v-else disabled style="back">
226 <uni-countdown
227 style="display: inline-block;"
228 :start="start"
229 :font-size="14"
230 :show-day="false"
231 :show-hour="false"
232 :show-min="false"
233 color="#FFFFFF"
234 splitorColor="#fff"
235 :minute="1"
236 :second="0"
237 @timeup="timeup"
238 />
239 </button>
240 </view>
241 </view>
242 </uni-popup-dialog>
243 </uni-popup>
244 </view>
245 </template> 3 </template>
246
247 <script setup>
248 import * as api from '@/common/api.js';
249 import { ref } from 'vue';
250 import { onLoad, onShow, onPullDownRefresh } from '@dcloudio/uni-app';
251 const vTypeImg = ref('/static/v1.png');
252 const card = ref({});
253 const reportData = ref({});
254 const user = ref({});
255 const userImg = ref('');
256 const avatarUrl = ref('');
257 const captchaPhonenumber = ref('');
258 const captcha = ref('');
259 const inputDialog = ref(null);
260 const start = ref(false);
261 const canSend = ref(true);
262 const app = getApp();
263 const isMaster = ref(false);
264
265 onPullDownRefresh(() => {
266 getVip();
267 });
268 onShow(() => {
269 if (app.globalData.isLogin) {
270 init();
271 getVip();
272 } else {
273 app.firstLoadCallback = () => {
274 init();
275 getVip();
276 };
277 }
278 });
279 function init() {
280 const currUser = uni.getStorageSync('currUser');
281 user.value = currUser;
282 if (user.value.manageFlag == '1' && app.globalData.venue.id == user.value.venueId) {
283 isMaster.value = true;
284 }
285 avatarUrl.value = user.value.avatar;
286 }
287 function getVip() {
288 getMemberInfo();
289 if (isMaster.value) {
290 api.getMaInfo().then(res => {
291 reportData.value = res.data;
292 });
293 }
294 }
295 function goBack() {
296 uni.navigateBack({});
297 }
298
299 function onChooseavatar(e) {
300 // 上传头像
301 match.uploadFile(e).then(data => {
302 avatarUrl.value = data.data;
303 match.updateAvatar({ avatarUrl: avatarUrl.value }).then(res => {
304 uni.showToast({
305 title: '头像保存成功',
306 icon: 'none',
307 duration: 2000
308 });
309 uni.setStorageSync('currUser', res.data);
310 });
311 });
312 }
313
314 function changePhoneNumber() {
315 inputDialog.value.open();
316 }
317 function dialogInputConfirm() {
318 // 修改手机号
319 const currUser = uni.getStorageSync('currUser');
320 api.maRebindMemberCard(captchaPhonenumber.value, captcha.value).then(res => {
321 uni.showToast({
322 title: res.msg,
323 icon: 'none',
324 duration: 2000
325 });
326 captcha.value = '';
327 getMemberInfo();
328 });
329 }
330
331
332 function goRenew() {
333 let path = '/pages/usercenter/mycard/renew';
334 uni.navigateTo({
335 url: path
336 });
337 }
338 function goCard() {
339 let path = '/pages/usercenter/mycard/mycard';
340 uni.navigateTo({
341 url: path
342 });
343 }
344 function goOrder() {
345 let path = '/pages/index/order';
346 uni.navigateTo({
347 url: path
348 });
349 }
350 function goBills() {
351 let path = '/pages/usercenter/bills';
352 uni.navigateTo({
353 url: path
354 });
355 }
356 function goVip() {
357 let path = '/pages/usercenter/mycard/mycard';
358 uni.navigateTo({
359 url: path
360 });
361 }
362 function goQcode() {
363 uni.scanCode({
364 onlyFromCamera: true,
365 success: function(res) {
366 console.log('条码类型:' + res.scanType);
367 console.log('条码内容:' + res.result);
368 api.scanQrCode(res.result).then(res => {
369 uni.showModal({
370 title: '提示',
371 content: res.msg,
372 success: function(res) {
373 if (res.confirm) {
374 console.log('确定');
375 } else if (res.cancel) {
376 console.log('取消');
377 }
378 }
379 });
380 });
381 }
382 });
383 }
384 function building() {
385 uni.showToast({
386 title: '暂未开放,敬请期待。',
387 icon: 'none',
388 duration: 2000
389 });
390 }
391
392 function myTrain() {
393 let path = '/pages/usercenter/myTrain/index/index';
394 uni.navigateTo({
395 url: path
396 });
397 }
398
399 function timeup() {
400 canSend.value = true;
401 }
402 function sendsms() {
403 //发送验证码
404 if (captchaPhonenumber.value) {
405 let strTemp = /^1[3|4|5|6|7|8|9][0-9]{9}$/;
406 if (strTemp.test(captchaPhonenumber.value)) {
407 api.getCaptchaSms({
408 phonenumber: captchaPhonenumber.value
409 }).then(res => {
410 uni.showToast({
411 title: res.msg,
412 icon: 'none',
413 duration: 2000
414 });
415 start.value = true;
416 canSend.value = false;
417 });
418 } else {
419 uni.showToast({
420 title: '请输入正确的手机号',
421 icon: 'none',
422 duration: 2000
423 });
424 }
425 } else {
426 uni.showToast({
427 title: '请输入手机号',
428 icon: 'none',
429 duration: 2000
430 });
431 }
432 }
433 </script>
434
435 <style scoped lang="scss">
436 .box {
437 width: 100vw;
438 overflow: hidden;
439 }
440 .rMainBox {
441 box-sizing: border-box;
442 padding: 20rpx 25rpx 0;
443 margin: 25rpx;
444 }
445 .userInfoBox {
446 height: 200rpx;
447 }
448 .nameBox {
449 position: absolute;
450 left: 180rpx;
451 top: 70rpx;
452 font-size: 30rpx;
453 }
454 .nameBox view {
455 color: #7b7f83;
456 font-size: 26rpx;
457 margin-top: 10rpx;
458 }
459 .goback {
460 position: absolute;
461 color: #fff;
462 top: 100rpx;
463 left: 35rpx;
464 }
465 .forAdmin {
466 padding: 25rpx;
467 box-sizing: border-box;
468 }
469 .topBg {
470 }
471 .onlyCardBottom {
472 position: relative;
473 width: 660rpx;
474 margin: auto;
475 height: 90rpx;
476 .bbg {
477 height: 90rpx;
478 width: 660rpx;
479 }
480 .cardBottom {
481 width: 660rpx;
482 background: transparent;
483 height: 90rpx;
484 text {
485 font-size: 28rpx;
486 color: #925921;
487 }
488 .renewBtn {
489 background: #874f02;
490 color: #fff;
491 }
492 }
493 }
494 .headImg {
495 border-radius: 50%;
496 position: relative;
497 top: 50rpx;
498 overflow: hidden;
499 width: 100rpx;
500 height: 100rpx;
501 border: 4px solid #ffffff;
502 background: #c4f9cb;
503 left: 40rpx;
504 button {
505 display: block;
506 padding: 0;
507 }
508 image {
509 width: 100rpx;
510 height: 100rpx;
511 display: block;
512 }
513 }
514
515 .slot-image {
516 width: 50rpx;
517 position: relative;
518 top: -8rpx;
519 height: 50rpx;
520 margin-right: 30rpx;
521 }
522
523 .myList {
524 }
525 .funcBar {
526 display: flex;
527 background: #fff;
528 width: 700rpx;
529 height: 140rpx;
530 justify-content: space-around;
531 }
532 .funcBar view {
533 display: flex;
534 align-items: center;
535 font-size: 36rpx;
536 }
537 .funcBar image {
538 width: 80rpx;
539 height: 80rpx;
540 }
541 .topbgimg {
542 width: 100vw;
543 position: absolute;
544 z-index: -1;
545 }
546 .reportItembox {
547 overflow: hidden;
548 display: flex;
549 flex-wrap: wrap;
550 justify-content: space-between;
551 }
552 .reportItem {
553 background: #fff;
554 border-radius: 15rpx;
555 width: 340rpx;
556 margin-top: 25rpx;
557 .t {
558 border-bottom: 1px solid #e5e5e5;
559 height: 70rpx;
560 line-height: 70rpx;
561 color: #2b3133;
562 font-size: 30rpx;
563 padding-left: 36rpx;
564 }
565 .rbody {
566 display: flex;
567 padding: 36rpx;
568 box-sizing: border-box;
569 view {
570 font-size: 26rpx;
571 color: #888;
572 width: 40%;
573 }
574 text {
575 color: #00c176;
576 font-weight: bold;
577 font-size: 36rpx;
578 display: block;
579 margin-bottom: 20rpx;
580 }
581 }
582 }
583 .changephonepop {
584 width: 100%;
585 }
586 .changephonepop view {
587 width: 100%;
588 margin: 0 0 30rpx;
589 }
590 .changephonepop view input {
591 width: 100%;
592 background: #f4f4f4;
593 font-size: 30rpx;
594 height: 80rpx;
595 padding: 0 15rpx;
596 box-sizing: border-box;
597 line-height: 80rpx;
598 }
599 .changephonepop view.ffff {
600 display: flex;
601 }
602 .changephonepop view button {
603 font-size: 24rpx;
604 margin-left: 10rpx;
605 white-space: nowrap;
606 width: 260rpx;
607 line-height: 80rpx;
608 background: linear-gradient(90deg, #00c176, #3ed89b);
609 color: #fff;
610 padding: 0;
611 border: none;
612 }
613 </style>
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!