From 4860b0a808a44d331d48264c8a79d59d97a77b6f Mon Sep 17 00:00:00 2001 From: chenkainan Date: Fri, 29 Nov 2024 15:09:03 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/calendar.vue | 386 ++++++++++++++++++++++++ manifest.json | 28 +- pages.json | 30 +- pages/index/index.vue | 426 ++++++--------------------- pages/login/login.vue | 30 +- pages/user/user.vue | 16 +- static/js/request.js | 8 +- subPackages/order/orderDetail.vue | 135 +++++++++ subPackages/order/orderList.vue | 163 ++++++++++ subPackages/user/accountPassword.vue | 50 ++++ 10 files changed, 892 insertions(+), 380 deletions(-) create mode 100644 components/calendar.vue create mode 100644 subPackages/order/orderDetail.vue create mode 100644 subPackages/order/orderList.vue create mode 100644 subPackages/user/accountPassword.vue diff --git a/components/calendar.vue b/components/calendar.vue new file mode 100644 index 0000000..77a50e1 --- /dev/null +++ b/components/calendar.vue @@ -0,0 +1,386 @@ + + + + + \ No newline at end of file diff --git a/manifest.json b/manifest.json index bd19b67..d49a8cd 100644 --- a/manifest.json +++ b/manifest.json @@ -76,20 +76,20 @@ }, "vueVersion" : "2", "h5" : { - // "devServer" : { - // "port" : 5173, //端口号 - // "disableHostCheck" : true, - // "proxy" : { - // "/api" : { - // "target" : "http://47.103.142.123:1010/", //目标接口域名 - // "changeOrigin" : true, //是否跨域 - // "secure" : true, // 设置支持https协议的代理 - // "pathRewrite" : { - // "^/api" : "" //意思就是把devApi这个替换成空 '' - // } - // } - // } - // }, + "devServer" : { + "port" : 5173, //端口号 + "disableHostCheck" : true, + "proxy" : { + "/api" : { + "target" : "http://47.103.142.123:1010/", //目标接口域名 + "changeOrigin" : true, //是否跨域 + "secure" : true, // 设置支持https协议的代理 + "pathRewrite" : { + "^/api" : "" //意思就是把devApi这个替换成空 '' + } + } + } + }, "router" : { "mode" : "history" }, diff --git a/pages.json b/pages.json index 94f464c..0a7227a 100644 --- a/pages.json +++ b/pages.json @@ -52,6 +52,24 @@ "style": { "navigationBarTitleText": "注册信息" } + }, + { + "path": "user/accountPassword", + "style": { + "navigationBarTitleText": "订单详情" + } + }, + { + "path": "order/orderList", + "style": { + "navigationBarTitleText": "我的订单" + } + }, + { + "path": "order/orderDetail", + "style": { + "navigationBarTitleText": "订单详情" + } } ] }], @@ -69,12 +87,12 @@ "selectedIconPath": "/static/images/homes.png", "text": "首页" }, - { - "pagePath": "pages/dialogue/index", - "iconPath": "/static/images/dialogue.png", - "selectedIconPath": "/static/images/dialogues.png", - "text": "对话" - }, + // { + // "pagePath": "pages/dialogue/index", + // "iconPath": "/static/images/dialogue.png", + // "selectedIconPath": "/static/images/dialogues.png", + // "text": "对话" + // }, { "pagePath": "pages/verification/index", "iconPath": "/static/images/hx.png", diff --git a/pages/index/index.vue b/pages/index/index.vue index 1ff6a6c..cfc2a30 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -1,7 +1,7 @@ @@ -351,7 +186,7 @@ .content { background: #FFFFFF; min-height: 100vh; - padding: 40rpx 26rpx 100rpx; + padding: 40rpx 26rpx 200rpx; } .topImg { @@ -406,99 +241,6 @@ margin: 4rpx auto 0; } } - - .calendar { - .calendar-top { - font-size: 27rpx; - font-family: PingFang SC; - font-weight: 500; - color: #000000; - padding: 59rpx 0 38rpx; - - view:nth-child(2) { - font-size: 35rpx; - font-weight: bold; - } - - .iconfont { - width: 11rpx; - height: 20rpx; - vertical-align: inherit; - } - } - - .calendar-bottom { - display: flex; - flex-wrap: wrap; - padding: 33rpx 0 40rpx; - width: 697rpx; - height: auto; - background: #FFFFFF; - border-radius: 20rpx; - position: relative; - - .week-item { - width: 14%; - text-align: center; - font-size: 24rpx; - font-family: PingFang SC; - font-weight: 500; - color: #666666; - } - - .day-box { - width: 14%; - height: 100rpx; - display: flex; - align-items: center; - justify-content: center; - - .day-item { - font-size: 29rpx; - font-family: PingFang SC; - font-weight: 500; - color: #000000; - display: flex; - flex-direction: column; - justify-content: space-around; - text-align: center; - - .day-lunar { - font-weight: 500; - font-size: 17rpx; - color: #999999; - text-align: center; - } - } - - .daySelect { - width: 80rpx; - height: 80rpx; - text-align: center; - background: #96684F; - border-radius: 27rpx; - color: #fff; - - .day-lunar { - color: #fff; - } - } - } - - .grayDate { - .day-item { - color: #999999; - } - } - - .iconfont { - width: 20rpx; - height: 20rpx; - display: block; - margin: 0 auto; - } - } - } .session-item { width: 697rpx; diff --git a/pages/login/login.vue b/pages/login/login.vue index cb3033a..52abefd 100644 --- a/pages/login/login.vue +++ b/pages/login/login.vue @@ -10,7 +10,7 @@ - + @@ -31,22 +31,34 @@ data() { return { form: { - username: '17717512304', - captchaCodeId: '558092', - password: '512304' + username: '', + captchaCodeId: '', + password: '' }, - showPassword: true + showPassword: true, + codeImg: '' } }, onShow() { - this.Post({},'/api/Merchants/get_graphic').then(res => { - console.log(res) - }) + this.getCodeImg() }, methods: { + // 获取验证码 + getCodeImg() { + this.Post({},'/api/Merchants/get_graphic').then(res => { + this.codeImg = res.data.code + }) + }, login() { this.Post(this.form,'/api/Merchants/login_member').then(res => { - console.log(res) + this.$store.commit('changeUserInfo', res.data) + if (this.$store.state.user.toPath.includes('user/user')) { + uni.switchTab({ + url: this.$store.state.user.toPath + }) + } else { + uni.navigateBack({}) + } }) } } diff --git a/pages/user/user.vue b/pages/user/user.vue index dcd8a70..7070be8 100644 --- a/pages/user/user.vue +++ b/pages/user/user.vue @@ -4,8 +4,8 @@ - 苏小小 - 大师级导游 + {{userInfo.nickname}} + {{userInfo.group_data.name}} @@ -34,14 +34,20 @@ }, { title: '我的订单', - path: '' + path: '/subPackages/order/orderList' }, { title: '账号密码', - path: '' + path: '/subPackages/user/accountPassword' } - ] + ], + userInfo: {} } + }, + onShow() { + this.Post({}, '/api/Merchants/get_login_details').then(res => { + this.userInfo = res.data + }) } } diff --git a/static/js/request.js b/static/js/request.js index 6e2a1e4..9320389 100644 --- a/static/js/request.js +++ b/static/js/request.js @@ -4,12 +4,12 @@ import store from '@/store' let NEWAPIURL = process.env.NODE_ENV == 'development' ? 'http://47.103.142.123:1010' : 'http://47.103.142.123:1010' Vue.prototype.NEWAPIURL = NEWAPIURL // #ifdef H5 - // NEWAPIURL = '/api' + NEWAPIURL = '/api' // #endif Vue.prototype.Post = (params, apiurl) => { - if (uni.getStorageSync('userInfo') && JSON.parse(uni.getStorageSync('userInfo')).token) params.token = JSON.parse(uni.getStorageSync('userInfo')).token - else if (store.state.user.userInfo.token) params.token = store.state.user.userInfo.token + if (uni.getStorageSync('userInfo') && JSON.parse(uni.getStorageSync('userInfo')).token) params.merchants_token = JSON.parse(uni.getStorageSync('userInfo')).token + else if (store.state.user.userInfo.token) params.merchants_token = store.state.user.userInfo.token return new Promise((resolve, reject) => { uni.showLoading({ title: '加载中' @@ -20,7 +20,7 @@ Vue.prototype.Post = (params, apiurl) => { data: params || {}, header: params.header || { 'content-type': 'application/json', - 'token': params.token || '' + 'merchants_token': params.merchants_token || '' }, success: res => { uni.hideLoading() diff --git a/subPackages/order/orderDetail.vue b/subPackages/order/orderDetail.vue new file mode 100644 index 0000000..1ce9a61 --- /dev/null +++ b/subPackages/order/orderDetail.vue @@ -0,0 +1,135 @@ + + + + + \ No newline at end of file diff --git a/subPackages/order/orderList.vue b/subPackages/order/orderList.vue new file mode 100644 index 0000000..2931006 --- /dev/null +++ b/subPackages/order/orderList.vue @@ -0,0 +1,163 @@ + + + + + \ No newline at end of file diff --git a/subPackages/user/accountPassword.vue b/subPackages/user/accountPassword.vue new file mode 100644 index 0000000..8edf664 --- /dev/null +++ b/subPackages/user/accountPassword.vue @@ -0,0 +1,50 @@ + + + + + \ No newline at end of file