代码提交

feature/v-xuexi
wangdong 10 months ago
parent 67001a2918
commit 1016002c43
  1. 8
      api/user.js
  2. 36
      pages.json
  3. 83
      pages/my/applyLink.vue
  4. 85
      pages/my/examApply.vue
  5. 12
      pages/my/feedback.vue
  6. 88
      pages/my/fileDownload.vue
  7. 25
      pages/my/helpCenter.vue
  8. 44
      pages/my/helpDetail.vue
  9. 86
      pages/my/noticeDetail.vue
  10. 100
      pages/my/noticeList.vue
  11. 106
      pages/store/shoppingCart.vue

@ -196,4 +196,12 @@ export function getAppid(){
} }
export function isForceBinding(){ export function isForceBinding(){
return http.get("/login/get_isforce_binding"); return http.get("/login/get_isforce_binding");
}
export function helpCenter(){
return http.get("/my/helpcenter");
}
export function addFeedback(){
return http.post("/my/addfeedback");
} }

@ -416,11 +416,47 @@
"navigationBarTitleText": "帮助与反馈" "navigationBarTitleText": "帮助与反馈"
} }
}, },
{
"path": "helpDetail",
"style": {
"navigationBarTitleText": "帮助与反馈"
}
},
{ {
"path": "feedback", "path": "feedback",
"style": { "style": {
"navigationBarTitleText": "帮助与反馈" "navigationBarTitleText": "帮助与反馈"
} }
},
{
"path": "fileDownload",
"style": {
"navigationBarTitleText": "文件下载"
}
},
{
"path": "examApply",
"style": {
"navigationBarTitleText": "考试信息"
}
},
{
"path": "applyLink",
"style": {
"navigationBarTitleText": "报名链接"
}
},
{
"path": "noticeList",
"style": {
"navigationBarTitleText": "消息中心"
}
},
{
"path": "noticeDetail",
"style": {
"navigationBarTitleText": "消息详情"
}
} }
] ]
}, },

@ -0,0 +1,83 @@
<template>
<BaseContainer class="apply-link flex">
<NavBar title="报名链接" />
<view class="link-list">
<view v-for="(item, index) in linkList" :key="index" class="link-item flex">
<view class="item-top">{{ item.name }}</view>
<view class="item-bottom" @click="openLink(item.link)">{{ item.link }}</view>
</view>
</view>
</BaseContainer>
</template>
<script>
export default {
data() {
return {
linkList: [
{ name: '雅思托福开始报名', link: 'https://www.baidu.com.cn' },
{ name: '雅思托福开始报名', link: 'https://www.baidu.com.cn' },
{ name: '雅思托福开始报名', link: 'https://www.baidu.com.cn' },
],
};
},
methods: {
openLink(link) {
// console.log(link);
// uni.navigateTo({
// url: link,
// });
},
},
};
</script>
<style lang="scss" scoped>
.apply-link {
flex-direction: column;
.link-list {
flex: 1;
width: 690rpx;
margin: 0 auto ;
padding-top: 20rpx;
.link-item {
height: 120rpx;
background: #fff;
padding: 24rpx 30rpx;
margin-bottom: 20rpx;
flex-direction: column;
justify-content: space-between;
.item-top {
font-size: 30rpx;
line-height: 30rpx;
color: #333;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.item-bottom {
color: #0F74BB;
font-size: 24rpx;
line-height: 24rpx;
}
}
}
.apply-btn {
width: 110rpx;
height: 110rpx;
background: linear-gradient(0deg, #0F74BB 0%, #3293FF 100%);
box-shadow: 0rpx 8rpx 22rpx 5rpx rgba(77,144,190,0.34);
border-radius: 50%;
justify-content: center;
position: fixed;
right: 56rpx;
bottom: 314rpx;
>view {
font-size: 22rpx;
color: #FFFFFF;
font-weight: bold;
width: 44rpx;
}
}
}
</style>

@ -0,0 +1,85 @@
<template>
<BaseContainer class="exam-info flex">
<NavBar title="考试信息" />
<view class="exam-list">
<view v-for="(item, index) in examList" :key="index" class="exam-item flex">
<view class="item-top">{{ item.name }}</view>
<view class="item-bottom">{{ item.time }}</view>
</view>
</view>
<view class="apply-btn flex flex-center-x" @click="toLink"><view>报名链接</view></view>
</BaseContainer>
</template>
<script>
export default {
data() {
return {
examList: [
{ name: '关于2022年度注册计量师职业资格考试考务工作 有关问题的通知', time: '2023-09-10 12:23:23'},
{ name: '关于2022年度注册计量师职业资格考试考务工作 有关问题的通知', time: '2023-09-10 12:23:23'},
{ name: '关于2022年度注册计量师职业资格考试考务工作 有关问题的通知', time: '2023-09-10 12:23:23'},
],
};
},
methods: {
toLink() {
uni.navigateTo({
url: '/pages/my/applyLink',
});
},
},
};
</script>
<style lang="scss" scoped>
.exam-info {
flex-direction: column;
.exam-list {
flex: 1;
width: 690rpx;
margin: 0 auto ;
padding-top: 20rpx;
.exam-item {
height: 170rpx;
background: #fff;
padding: 24rpx 20rpx 30rpx 30rpx;
margin-bottom: 20rpx;
flex-direction: column;
justify-content: space-between;
.item-top {
font-size: 28rpx;
line-height: 35rpx;
height: 70rpx;
color: #333;
-webkit-line-clamp: 2;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-box-orient: vertical;
}
.item-bottom {
color: #999;
font-size: 24rpx;
line-height: 24rpx;
}
}
}
.apply-btn {
width: 110rpx;
height: 110rpx;
background: linear-gradient(0deg, #0F74BB 0%, #3293FF 100%);
box-shadow: 0rpx 8rpx 22rpx 5rpx rgba(77,144,190,0.34);
border-radius: 50%;
justify-content: center;
position: fixed;
right: 56rpx;
bottom: 314rpx;
>view {
font-size: 22rpx;
color: #FFFFFF;
font-weight: bold;
width: 44rpx;
}
}
}
</style>

@ -9,6 +9,7 @@
</template> </template>
<script> <script>
import { addFeedback } from '@/api/user';
export default { export default {
data() { data() {
return { return {
@ -16,10 +17,19 @@
}; };
}, },
methods: { methods: {
submitFeedback() { async submitFeedback() {
if (!this.suggest) { if (!this.suggest) {
return this.$util.showMsg("请输入您的意见和建议"); return this.$util.showMsg("请输入您的意见和建议");
} }
try{
const { data } = await addFeedback({ content: this.suggest });
this.$util.showMsg("提交成功");
setTimeout(() => {
uni.navigateBack();
}, 1000);
}catch(e){
//TODO handle the exception
}
}, },
}, },
}; };

@ -0,0 +1,88 @@
<template>
<BaseContainer class="file-download flex">
<NavBar title="文件下载" />
<view class="file-box">
<view class="file-list">
<view v-for="(item, index) in fileList" :key="index" class="file-item flex">
<image :src="item.pic" mode="aspectFill"></image>
<view class="file-info flex">
<view class="info-top">{{ item.name }}</view>
<view class="info-bottom flex flex-center-x">
<text>{{ item.downloadCount }}人已下载</text>
<text>去下载</text>
</view>
</view>
</view>
</view>
</view>
</BaseContainer>
</template>
<script>
export default {
data() {
return {
fileList: [
{ pic: '', name: '雅思托福文件资料下载雅思托福 文件资料下载', url: '', downloadCount: 10000 },
{ pic: '', name: '雅思托福文件资料下载雅思托福 文件资料下载', url: '', downloadCount: 10000 },
{ pic: '', name: '雅思托福文件资料下载雅思托福 文件资料下载', url: '', downloadCount: 10000 },
]
};
},
};
</script>
<style lang="scss" scoped>
.file-download {
flex-direction: column;
.file-box {
flex: 1;
width: 690rpx;
margin: 0 auto ;
padding-top: 20rpx;
.file-list {
.file-item {
height: 180rpx;
background: #fff;
padding: 20rpx 16rpx 24rpx;
margin-bottom: 20rpx;
>image {
width: 210rpx;
height: 136rpx;
margin-right: 33rpx;
flex-shrink: 0;
}
.file-info {
flex: 1;
flex-direction: column;
justify-content: space-between;
.info-top {
font-size: 28rpx;
line-height: 35rpx;
height: 70rpx;
color: #333;
-webkit-line-clamp: 2;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-box-orient: vertical;
}
.info-bottom {
color: #666;
font-size: 20rpx;
justify-content: space-between;
>text:last-child {
width: 110rpx;
height: 38rpx;
background: #0F74BB;
border-radius: 19rpx;
color: #fff;
text-align: center;
line-height: 38rpx;
}
}
}
}
}
}
}
</style>

@ -12,7 +12,7 @@
</view> </view>
</view> </view>
<view class="section-list"> <view class="section-list">
<view class="section-link" v-for="(item, index) in menuList" :key="index" @click="goUrl(item.url)" > <view class="section-link" v-for="(item, index) in menuList" :key="index" @click="goDetail(item)" >
{{ item.title }} {{ item.title }}
<view class="menu-more"></view> <view class="menu-more"></view>
</view> </view>
@ -21,6 +21,7 @@
</template> </template>
<script> <script>
import { helpCenter } from '@/api/user';
export default { export default {
data() { data() {
return { return {
@ -32,19 +33,29 @@
], ],
}; };
}, },
onLoad() {
this.getHelpCenterData();
},
methods: { methods: {
goUrl(url) { goDetail(item) {
if (url) { uni.navigateTo({
uni.navigateTo({ url: `/pages/my/helpDetail?title=${item.title}&content=${item.content}`
url, })
});
}
}, },
toFeedback() { toFeedback() {
uni.navigateTo({ uni.navigateTo({
url: '/pages/my/feedback', url: '/pages/my/feedback',
}) })
}, },
async getHelpCenterData() {
try{
const { data } = await helpCenter();
console.log(data);
this.menuList = data.helpcenter;
}catch(e){
//TODO handle the exception
}
},
}, },
}; };
</script> </script>

@ -0,0 +1,44 @@
<template>
<BaseContainer>
<NavBar :title="title" />
<mp-html
v-if="!!content"
class="swiper-conter"
container-style="padding: 30rpx;background: #ffffff;"
:content="content"
></mp-html>
</BaseContainer>
</template>
<script>
import mpHtml from "mp-html/dist/uni-app/components/mp-html/mp-html.vue";
export default {
components: {
mpHtml,
},
data() {
return {
title: '',
content: "",
};
},
onLoad(options) {
this.title = options.title;
this.content = options.content;
},
methods: {
},
};
</script>
<style scoped lang="scss">
::v-deep {
._root {
width: 690rpx;
margin: 20rpx auto 0;
padding: 60rpx 40rpx!important;
}
}
</style>

@ -0,0 +1,86 @@
<template>
<BaseContainer>
<NavBar :title="info.title" />
<view class="info">
<view class="info-box flex flex-center-x">
<image :src="info.pic" mode="aspectFill"></image>
<view class="box-content">
<view>{{ info.title }}</view>
<view>{{ info.time }}</view>
</view>
</view>
<mp-html
v-if="!!info.content"
class="swiper-conter"
container-style="padding: 30rpx;background: #ffffff;"
:content="info.content"
></mp-html>
</view>
</BaseContainer>
</template>
<script>
import mpHtml from "mp-html/dist/uni-app/components/mp-html/mp-html.vue";
export default {
components: {
mpHtml,
},
data() {
return {
info: {},
};
},
onLoad(options) {
console.log(options);
this.info = options.info ? JSON.parse(options.info) : {};
console.log(this.info);
},
methods: {
},
};
</script>
<style scoped lang="scss">
::v-deep {
._root {
width: 690rpx;
margin: 20rpx auto 0;
padding: 60rpx 40rpx!important;
}
}
.info {
width: 690rpx;
margin: 10rpx auto 0;
background: #FFFFFF;
border-radius: 10rpx;
.info-box {
padding: 45rpx 0 15rpx;
border-bottom: 1rpx solid #E6E6E6;
image {
width: 83rpx;
height: 83rpx;
flex-shrink: 0;
margin-right: 20rpx;
}
.box-content {
flex: 1;
view {
color: #999999;
font-size: 20rpx;
line-height: 20rpx;
&:first-child {
color: #333;
font-size: 30rpx;
line-height: 30rpx;
margin-bottom: 20rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}
}
}
}
</style>

@ -0,0 +1,100 @@
<template>
<BaseContainer class="notice flex">
<NavBar title="消息中心" />
<view class="notice-list">
<view v-for="(item, index) in noticeList" class="notice-item flex flex-center-x" @click="toDetail(item)">
<image :src="item.pic" mode="aspectFill"></image>
<view class="item-info">
<view>{{ item.title }}</view>
<view>{{ item.content }}</view>
</view>
<view class="item-right">
<view>{{ item.time }}</view>
<view v-if="num > 1" class="num">{{ item.num }}</view>
</view>
</view>
</view>
</BaseContainer>
</template>
<script>
export default {
data() {
return {
noticeList: [
{ pic: '', title: '梦航课程', content: '您预约报名的课程即将开始,请及时您预约报名的课程即将开始,请及时关注', time: '11:16', num: 6},
{ pic: '', title: '通知消息', content: '您的退款已申请通过,请您及时查收账户您的退款已申请通过,请您及时查收账户', time: '2023-12-30', num: 1},
{ pic: '', title: '通知消息', content: '您的退款已申请通过,请您及时查收账户您的退款已申请通过,请您及时查收账户', time: '2023-12-30', num: 1},
]
};
},
methods: {
toDetail(item) {
uni.navigateTo({
url: `/pages/my/noticeDetail?info=${JSON.stringify(item)}`
})
},
},
};
</script>
<style lang="scss" scoped>
.notice {
flex-direction: column;
.notice-list {
flex: 1;
width: 100%;
padding: 20rpx 30rpx;
background: #fff;
.notice-item {
height: 164rpx;
border-bottom: 1px solid #E6E6E6;
image {
width: 84rpx;
height: 84rpx;
}
.item-info {
width: 450rpx;
margin: 0 auto 0 22rpx;
>view {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
font-size: 24rpx;
line-height: 24rpx;
color: #999;
&:first-child {
font-size: 30rpx;
line-height: 30rpx;
color: #333;
margin-bottom: 20rpx;
}
}
}
.item-right {
display: flex;
flex-direction: column;
align-items: flex-end;
>view{
&:first-child {
font-size: 20rpx;
line-height: 30rpx;
color: #999;
margin-bottom: 28rpx;
}
&.num {
width: 22rpx;
height: 22rpx;
background: #FE4944;
border-radius: 50%;
font-size: 18rpx;
color: #fff;
text-align: center;
line-height: 22rpx;
}
}
}
}
}
}
</style>

@ -8,7 +8,7 @@
</view> </view>
<view class="list"> <view class="list">
<view v-for="item in goodsList" :key="item.id" class="item"> <view v-for="item in goodsList" :key="item.id" class="item">
<i class="iconfont icongouxuan" :class="{ active: checkedGoods.includes(item.productInfo.id) }" @click="checkGoods(item.productInfo.id)"></i> <i class="iconfont icongouxuan" :class="{ active: checkedGoods.includes(item.id) }" @click="checkGoods(item.id)"></i>
<view class="image"> <view class="image">
<image mode="aspectFit" class="img" :src="item.productInfo.image" alt="" /> <image mode="aspectFit" class="img" :src="item.productInfo.image" alt="" />
</view> </view>
@ -43,14 +43,11 @@
<view v-if="!isEdit" class="pay-btn" @click="toPay">去结算<text v-if="checkedGoods.length > 0">({{ checkedGoods.length }})</text></view> <view v-if="!isEdit" class="pay-btn" @click="toPay">去结算<text v-if="checkedGoods.length > 0">({{ checkedGoods.length }})</text></view>
<view v-else class="delete-btn" @click="deleteGoods">删除</view> <view v-else class="delete-btn" @click="deleteGoods">删除</view>
</view> </view>
<PayDialog v-if="initDataLoading" :open.sync="payDialogOpen" :money="Number(total)" :now_money="now_money"
:pay_type_num="pay_type_num" :special_id="Number(special_id)" :is-wechat="isWechat" :is-alipay="is_alipay" :is-balance="is_yue"
:template-id="templateId" :wxpay-h5="wxpayH5" @change="changeVal" />
</BaseContainer> </BaseContainer>
</template> </template>
<script> <script>
import { getCartList, deleteCart } from "@/api/store"; import { getCartList, deleteCart, createOrder } from "@/api/store";
import { import {
getInitData getInitData
} from "@/api/special"; } from "@/api/special";
@ -76,6 +73,7 @@
wxpayH5: false, wxpayH5: false,
initDataLoading: false, initDataLoading: false,
isEdit: false, isEdit: false,
createOrder,
}; };
}, },
watch: { watch: {
@ -85,7 +83,7 @@
console.log(this.checkedGoods); console.log(this.checkedGoods);
let total = 0; let total = 0;
this.goodsList.forEach(v => { this.goodsList.forEach(v => {
if (this.checkedGoods.includes(v.productInfo.id)) { if (this.checkedGoods.includes(v.id)) {
total += Number(v.cart_num) * Number(v.productInfo.price); total += Number(v.cart_num) * Number(v.productInfo.price);
} }
}); });
@ -97,7 +95,7 @@
handler() { handler() {
let total = 0; let total = 0;
this.goodsList.forEach(v => { this.goodsList.forEach(v => {
if (this.checkedGoods.includes(v.productInfo.id)) { if (this.checkedGoods.includes(v.id)) {
total += Number(v.cart_num) * Number(v.productInfo.price); total += Number(v.cart_num) * Number(v.productInfo.price);
} }
}); });
@ -129,7 +127,7 @@
if (this.allSelect) { if (this.allSelect) {
const arr = []; const arr = [];
this.goodsList.forEach(v => { this.goodsList.forEach(v => {
arr.push(v.productInfo.id); arr.push(v.id);
}); });
this.checkedGoods = arr; this.checkedGoods = arr;
} else { } else {
@ -175,7 +173,7 @@
}); });
uni.hideLoading(); uni.hideLoading();
this.$util.showMsg("删除成功"); this.$util.showMsg("删除成功");
this.goodsList = this.goodsList.filter(item => !this.checkedGoods.includes(item.productInfo.id)); this.goodsList = this.goodsList.filter(item => !this.checkedGoods.includes(item.id));
this.checkedGoods = []; this.checkedGoods = [];
} catch (err) { } catch (err) {
uni.hideLoading(); uni.hideLoading();
@ -186,80 +184,30 @@
} }
}, },
toPay() { toPay() {
console.log(111);
if (this.total === 0) { if (this.total === 0) {
console.log(111);
this.$util.showMsg("请选择商品"); this.$util.showMsg("请选择商品");
} else { } else {
this.payDialogOpen = true; uni.navigateTo({
console.log(111); url: "/pages/special/confirm_order?cartId=" + 544,
} });
}, // this.$util.checkLogin(async () => {
// try {
changeVal(opt) { // const { code, data, msg } = await createOrder({
if (typeof opt !== "object") { // productId: this.storeInfo.id,
opt = {}; // cartNum: 1,
// });
// if (code === 200) {
// uni.navigateTo({
// url: "/pages/special/confirm_order?cartId=" + data.cartId,
// });
// } else {
// this.$util.showMsg(msg);
// }
// } catch (err) {
// this.$util.showMsg(err.msg);
// }
// }, true);
} }
console.log(opt);
var action = opt.action || "";
var value = opt.value || "";
this[action] && this[action](value);
},
//
pay_order: function (data) {
this.orderId = data.data.result.orderId || "";
switch (data.data.status) {
case "PAY_ERROR":
case "ORDER_EXIST":
case "ORDER_ERROR":
this.extendOrder(data.msg);
break;
case "WECHAT_PAY":
this.wechatPay(data.data.result.jsConfig);
break;
case "WECHAT_H5_PAY":
this.payDialogOpen = false;
this.$util.wechatH5Pay(data.data.result.jsConfig, this);
break;
case "WECHAT_ROUTINE_PAY":
this.$util.wechatRoutinePay(data.data.result.jsConfig, this);
break;
case "SUCCESS":
this.successOrder(data.msg);
break;
case "ZHIFUBAO_PAY":
this.aliPay(data.data.result, "datadownload");
break;
case 'TOUTIAO_PAY':
this.$util.toutiaoPay(data.data.result.jsConfig, this);
break;
case 'KUAISHOU_PAY':
this.$util.kuaishouPay(data.data.result.jsConfig, this);
break
}
},
extendOrder(msg) {
if (typeof msg === "object" && msg.errMsg === "chooseWXPay:cancel") {
msg = "微信支付取消";
} else {
msg = "支付失败";
}
this.$util.showMsg(msg);
this.payDialogOpen = false;
if (this.orderId) {
delSpecialOrder(this.orderId);
}
},
wechatPay(config) {
this.$util.weixinpay(config, this);
},
successOrder(msg) {
this.$util.showMsg(msg ? msg : "支付成功");
this.payDialogOpen = false;
this.submitApply();
},
aliPay(msn, type) {
this.$util.aliPay(msn, type, this);
}, },
}, },
}; };

Loading…
Cancel
Save