diff --git a/api/api.js b/api/api.js
index 920e8f1..635da6f 100644
--- a/api/api.js
+++ b/api/api.js
@@ -419,6 +419,28 @@ const config = {
method: 'GET',
auth : true,
},
+
+ // 新-获取我的客服信息列表
+ getMyService : {
+ url: '/token/getMyService',
+ method: 'GET',
+ auth : true,
+ },
+
+ // 新-获取大转盘抽奖列表
+ getLuckDrawList : {
+ url: '/token/getLuckDrawList',
+ method: 'GET',
+ auth : true,
+ },
+
+ // 新-大转盘抽奖
+ luckDraw : {
+ url: '/token/luckDraw',
+ method: 'POST',
+ auth : true,
+ showLoading : true,
+ },
}
const models = ['order']
diff --git a/mixins/list.js b/mixins/list.js
index d01a425..9e55cc9 100644
--- a/mixins/list.js
+++ b/mixins/list.js
@@ -55,9 +55,9 @@ export default {
success(res.result)
- this[this.mixinsListKey || 'list'] = res.result.records
+ this[this.mixinsListKey || 'list'] = res.result.records || res.result
- this.total = res.result.total
+ this.total = res.result.total || res.result.length
}
})
})
diff --git a/mixins/loadList.js b/mixins/loadList.js
new file mode 100644
index 0000000..a2f0c81
--- /dev/null
+++ b/mixins/loadList.js
@@ -0,0 +1,107 @@
+
+
+
+function query(self, queryParams){
+ // return (self.beforeGetData && self.beforeGetData()) ||
+ // queryParams || self.queryParams
+
+ // 深度合并对象
+ return self.$utils.deepMergeObject(
+
+ self.$utils.deepMergeObject(self.queryParams,
+
+ (self.beforeGetData && self.beforeGetData()) || {}),
+
+ queryParams)
+}
+
+
+
+export default {
+ data() {
+ return {
+ queryParams: {
+ pageNo: 1,
+ pageSize: 10,
+ },
+ total : 0,
+ List : [],
+ hasMore: true, // 是否还有更多数据
+ loading: false, // 是否正在加载
+ }
+ },
+ onPullDownRefresh() {
+ this.refreshList()
+ },
+ onReachBottom() {
+ this.loadMore()
+ },
+ onLoad() {
+ this.refreshList()
+ },
+ methods: {
+ // 刷新列表
+ refreshList() {
+ this.queryParams.pageNo = 1;
+ this.hasMore = true;
+ this.List = [];
+ this.loadList();
+ },
+
+ // 加载更多
+ loadMore() {
+ console.log(this.hasMore , this.loading);
+
+ if (!this.hasMore || this.loading) return;
+ this.queryParams.pageNo++;
+ this.loadList();
+ },
+
+ // 加载订单列表
+ loadList() {
+ return new Promise((success, error) => {
+ if(!this.mixinsListApi){
+ return console.error('mixinsListApi 缺失');
+ }
+ if (this.loading) return;
+
+ this.loading = true;
+
+ const params = {
+ ...this.queryParams,
+ };
+
+
+ this.$api(this.mixinsListApi, query(this, params), res => {
+ this.loading = false;
+ uni.stopPullDownRefresh();
+
+ if (res.code === 200 && res.result) {
+
+ this.getDataThen && this.getDataThen(res.result.records, res.result.total, res.result)
+
+ success(res.result)
+
+ const newList = res.result.records || [];
+ this.total = res.result.total
+
+ if (this.pageNo === 1) {
+ this.List = newList;
+ } else {
+ this.List = [...this.List, ...newList];
+ }
+
+ // 判断是否还有更多数据
+ this.hasMore = newList.length >= this.queryParams.pageSize;
+ } else {
+ uni.showToast({
+ title: res.message || '加载失败',
+ icon: 'none'
+ });
+ error(res)
+ }
+ })
+ })
+ },
+ }
+}
\ No newline at end of file
diff --git a/pages/index/center.vue b/pages/index/center.vue
index 6822459..1585c5a 100644
--- a/pages/index/center.vue
+++ b/pages/index/center.vue
@@ -260,7 +260,7 @@
// 检查是否有用户信息或token来判断登录状态
const token = uni.getStorageSync('token')
if (token) {
- this.mixinsListApi = 'getMyPostPage'
+ this.mixinsListApi = this.apiList[this.type]
this.isLogin = true
this.$store.commit('getUserInfo')
this.getData()
diff --git a/pages/index/index.vue b/pages/index/index.vue
index 83fd4ab..0fe5fc8 100644
--- a/pages/index/index.vue
+++ b/pages/index/index.vue
@@ -133,7 +133,7 @@
-
@@ -181,7 +181,8 @@
import sharePopup from '@/components/user/sharePopup.vue'
import signInOnePopup from '@/components/user/signInOnePopup.vue'
import dynamicItem from '@/components/list/dynamic/dynamicItem.vue'
- import mixinsList from '@/mixins/list.js'
+ // import mixinsList from '@/mixins/list.js'
+ import mixinsList from '@/mixins/loadList.js'
import {
mapState
} from 'vuex'
@@ -250,7 +251,7 @@
} else {
delete this.queryParams.classId
}
- this.getData()
+ this.refreshList()
},
//订阅模版消息
onSubscribeMessageTap(){
diff --git a/pages_order/auth/wxUserInfo.vue b/pages_order/auth/wxUserInfo.vue
index 9c49ae6..55a1960 100644
--- a/pages_order/auth/wxUserInfo.vue
+++ b/pages_order/auth/wxUserInfo.vue
@@ -87,12 +87,12 @@
+ v-model="form.czSchool" />
+ v-model="form.gzSchool" />
@@ -150,8 +150,8 @@
yearDate : this.$dayjs().add(-18, 'y').valueOf(),//默认满18岁
address : '',
phone : '',
- middleSchool: '',
- highSchool: '',
+ czSchool: '',
+ gzSchool: '',
},
maxDate : this.$dayjs().valueOf(),
minDate : this.$dayjs().add(-100, 'y').valueOf(),
@@ -247,9 +247,9 @@
this.form.address = res.result.address || this.form.address
- this.form.middleSchool = res.result.middleSchool || this.form.middleSchool
+ this.form.czSchool = res.result.czSchool || this.form.czSchool
- this.form.highSchool = res.result.highSchool || this.form.highSchool
+ this.form.gzSchool = res.result.gzSchool || this.form.gzSchool
}
})
},
diff --git a/pages_order/marketing/turntable.vue b/pages_order/marketing/turntable.vue
index ffa9e63..6715abd 100644
--- a/pages_order/marketing/turntable.vue
+++ b/pages_order/marketing/turntable.vue
@@ -13,8 +13,20 @@
转一转,好运来!
+
+
+
+ 当前积分:
+ {{ userPoints }}
+
+
+ 每次消耗:
+ {{ drawCost }}积分
+
+
+
-
+
@@ -24,8 +36,8 @@
:key="index"
class="wheel-sector"
:style="{
- backgroundColor: sectorColors[index],
- transform: `rotate(${index * 45}deg)`
+ backgroundColor: sectorColors[index % sectorColors.length],
+ transform: `rotate(${index * sectorAngle}deg)`
}"
>
@@ -40,9 +52,9 @@
:style="prizeStyles[index]"
>
- {{ prize.icon }}
- {{ prize.name }}
- {{ prize.value }}
+ {{ getIcon(prize.type) }}
+ {{ prize.title }}
+ ¥{{ prize.price }}
@@ -54,19 +66,31 @@
-
- {{ isSpinning ? '抽奖中...' : '开始抽奖' }}
+
+ {{ getButtonText() }}
+
+
+
+ 加载中...
+
+
🎉 恭喜您 🎉
- {{ currentPrize.icon }}
- {{ currentPrize.name }}
- {{ currentPrize.value }}
+
+
+
+
+ {{ currentPrize.title }}
+ ¥{{ currentPrize.price }}
+
+
+ {{ getPointsChangeText() }}
@@ -74,29 +98,28 @@
-
+
- 今日剩余抽奖次数: {{ remainingSpins }}
+ 消耗{{ drawCost }}积分即可抽奖,快来试试手气吧!