diff --git a/common/http.api.js b/common/http.api.js
index 4233483..4aafb3b 100644
--- a/common/http.api.js
+++ b/common/http.api.js
@@ -4,6 +4,7 @@ let apiApp = {
user: '/api/mobile/user/show',
saveUser: '/api/mobile/user/save',
getUserMobile: '/api/mobile/user/mobile',
+ getConfig: '/api/mobile/user/config',
getUserAddress: '/api/mobile/user/address',
saveUserAddress: '/api/mobile/user/address-update',
@@ -12,7 +13,9 @@ let apiApp = {
saveFeedback: '/api/mobile/user/feedback-update',
getCard: '/api/mobile/user/get-card',
- getDates: '/api/mobile/user/get-available-dates',
+ getDates: '/api/mobile/user/get-available-dates',
+ getExpress:'/api/mobile/user/express-type',
+
getUserOrder: '/api/mobile/user/delivery',
addUserOrder: '/api/mobile/user/confirm',
@@ -32,13 +35,17 @@ const install = (Vue, vm) => {
let login = (params = {}) => vm.$u.get(apiApp.login, params);
let user = (params = {}) => vm.$u.get(apiApp.user, params);
let getUserMobile = (params = {}) => vm.$u.get(apiApp.getUserMobile, params);
+ let getConfig = (params = {}) => vm.$u.get(apiApp.getConfig, params);
+
let saveUser = (params = {}) => vm.$u.post(apiApp.saveUser, params);
let getUserAddress = (params = {}) => vm.$u.get(apiApp.getUserAddress, params);
let saveUserAddress = (params = {}) => vm.$u.post(apiApp.saveUserAddress, params);
let delUserAddress = (params = {}) => vm.$u.get(apiApp.delUserAddress, params);
let saveFeedback = (params = {}) => vm.$u.post(apiApp.saveFeedback, params);
let getCard = (params = {}) => vm.$u.get(apiApp.getCard, params);
- let getDates = (params = {}) => vm.$u.get(apiApp.getDates, params);
+ let getDates = (params = {}) => vm.$u.get(apiApp.getDates, params);
+ let getExpress = (params = {}) => vm.$u.get(apiApp.getExpress, params);
+
let getUserOrder = (params = {}) => vm.$u.get(apiApp.getUserOrder, params);
let addUserOrder = (params = {}) => vm.$u.post(apiApp.addUserOrder, params);
@@ -50,14 +57,16 @@ const install = (Vue, vm) => {
vm.$u.api = {
login,
user,
- getUserMobile,
+ getUserMobile,
+ getConfig,
saveUser,
getUserAddress,
saveUserAddress,
delUserAddress,
saveFeedback,
- getCard,
- getDates,
+ getCard,
+ getDates,
+ getExpress,
getUserOrder,
addUserOrder,
saveUserOrder,
diff --git a/components/date-picker/date-picker.vue b/components/date-picker/date-picker.vue
index 3b91381..e860ce7 100644
--- a/components/date-picker/date-picker.vue
+++ b/components/date-picker/date-picker.vue
@@ -12,7 +12,7 @@
{{item.value}}
+ v-if="item.name">{{item.name}}
送货时间
@@ -26,11 +26,13 @@
-
+
{{dateObj.lunarData?dateObj.lunarData:''}}
+ 今日剩余可提货量:{{dateObj.canUse.quantity - dateObj.canUse.booked}}
-
{{item}}
@@ -45,8 +47,12 @@
-
\ No newline at end of file
diff --git a/pages/change/change.vue b/packages/change/change.vue
similarity index 100%
rename from pages/change/change.vue
rename to packages/change/change.vue
diff --git a/packages/my/addaddress.vue b/packages/my/addaddress.vue
index 078145c..a73e446 100644
--- a/packages/my/addaddress.vue
+++ b/packages/my/addaddress.vue
@@ -1,36 +1,52 @@
-
- 微信地址
-
-
-
-
-
-
-
-
- *地区
- 获取位置
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 定位
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 获取微信地址
+
+
+
+
+
+
提交
-
-
-
+
+
+
@@ -39,7 +55,7 @@
toast,
isMobile,
isNull
- } from '@/common/util.js'
+ } from '@/common/util.js'
import auiPicker from '@/components/aui-picker.vue';
export default {
components: {
@@ -47,14 +63,15 @@
},
data() {
return {
+ itemtype: 'add',
form: {
area: '',
address: '',
contact: '',
- mobile: '',
- defalut:false
- },
- listArea:[],
+ mobile: '',
+ defalut: false
+ },
+ listArea: [],
showArea: false,
rules: {
area: [{
@@ -90,73 +107,80 @@
this.$refs.uForm.setRules(this.rules);
},
- onLoad(option) {
- if(uni.getStorageSync('vuex_address')){
- this.form = uni.getStorageSync('vuex_address')
- uni.removeStorageSync('vuex_address')
- }
+ onLoad(option) {
+ this.itemtype = option.type ? option.type : ''
+ if (uni.getStorageSync('vuex_address')) {
+ this.form = uni.getStorageSync('vuex_address')
+ if (this.itemtype === 'copy') {
+ this.form.id = ''
+ this.form.defalut = 0
+ }
+ uni.removeStorageSync('vuex_address')
+ }
this.getArea()
},
- methods: {
- async getArea() {
- const res = await this.$u.api.getRegion()
- this.listArea = res.regions
- },
- openArea() {
- this.$refs.pickers.open().then(function() {
- console.log('picker打开');
- });
- },
- changeArea(e) {
- console.log(e)
- // return
- if (e) {
-
- let data = e.data
- let _this = this
- _this.form.area=''
- data.forEach(function(item, index) {
- _this.form.area += item.value + '';
- });
- this.form.province_id = data[0] ? data[0].id : ''
- this.form.city_id = data[1] ? data[1].id : ''
- this.form.district_id = data[2] ? data[2].id : ''
- }
- },
- getAddress(){
- let _this = this
- uni.authorize({
- scope: 'scope.address',
- success: (res) => {
- console.log("authorize", res)
- uni.chooseAddress({
- success(res){
- console.log(res)
- _this.form.contact = res.userName
- _this.form.mobile = res.telNumber
- _this.form.area = res.provinceName+res.cityName+res.countyName
- _this.form.address = res.detailInfo
- _this.$u.api.matchRegion({
- province: res.provinceName,
- city: res.cityName,
- district: res.countyName
- }).then(res1 => {
- _this.form.province_id = res1.province_id ? res1.province_id.id : ''
- _this.form.city_id = res1.city_id ? res1.city_id.id : ''
- _this.form.district_id = res1.district_id ? res1.district_id.id : ''
- })
- console.log("_this",_this.form)
- },
- fail(res){
- console.log(res)
- }
- })
- },
- fail(res) {
- console.log("authorize-fail", res)
- }
- })
-
+ methods: {
+ async getArea() {
+ const res = await this.$u.api.getRegion()
+ this.listArea = res.regions
+ },
+ openArea() {
+ this.$refs.pickers.open().then(function() {
+ console.log('picker打开');
+ });
+ },
+ changeArea(e) {
+ console.log(e)
+ // return
+ if (e) {
+
+ let data = e.data
+ let _this = this
+ _this.form.area = ''
+ data.forEach(function(item, index) {
+ _this.form.area += item.value + '';
+ });
+ this.form.province_id = data[0] ? data[0].id : ''
+ this.form.city_id = data[1] ? data[1].id : ''
+ this.form.district_id = data[2] ? data[2].id : ''
+ }
+ },
+ getAddress() {
+ let _this = this
+ uni.authorize({
+ scope: 'scope.address',
+ success: (res) => {
+ console.log("authorize", res)
+ uni.chooseAddress({
+ success(res) {
+ console.log(res)
+ _this.form.contact = res.userName
+ _this.form.mobile = res.telNumber
+ _this.form.area = res.provinceName + res.cityName + res.countyName
+ _this.form.address = res.detailInfo
+ _this.$u.api.matchRegion({
+ province: res.provinceName,
+ city: res.cityName,
+ district: res.countyName
+ }).then(res1 => {
+ _this.form.province_id = res1.province_id ? res1
+ .province_id.id : ''
+ _this.form.city_id = res1.city_id ? res1.city_id.id : ''
+ _this.form.district_id = res1.district_id ? res1
+ .district_id.id : ''
+ })
+ console.log("_this", _this.form)
+ },
+ fail(res) {
+ console.log(res)
+ }
+ })
+ },
+ fail(res) {
+ console.log("authorize-fail", res)
+ }
+ })
+
},
changeLocation() {
let _this = this
@@ -180,23 +204,23 @@
}
})
},
- submit() {
- console.log(this.form)
+ submit() {
+ console.log(this.form)
// return
this.$refs.uForm.validate(valid => {
-
- if (valid) {
- if(this.form.defalut){
- this.form.defalut = 1
- }
- this.$u.api.saveUserAddress(this.form).then(res=>{
- toast('提交成功',1000,function(){
- setTimeout(function(){
- uni.navigateBack(-1)
- },500)
-
- })
-
+
+ if (valid) {
+ if (this.form.defalut) {
+ this.form.defalut = 1
+ }
+ this.$u.api.saveUserAddress(this.form).then(res => {
+ toast('提交成功', 1000, function() {
+ setTimeout(function() {
+ uni.navigateBack(-1)
+ }, 500)
+
+ })
+
})
} else {
console.log('验证失败');
@@ -211,43 +235,48 @@
\ No newline at end of file
diff --git a/packages/my/score.vue b/packages/my/score.vue
index 3b97d03..c9fad09 100644
--- a/packages/my/score.vue
+++ b/packages/my/score.vue
@@ -1,38 +1,38 @@
-
-
+
+
+ 1580
+
+ 积分规则
+
+
+
+
+
- 时间:2023-11-02
-
-
- 积分余额:1000
-
+
+ 积分获取
- 兑换记录:123
-
-
- 兑换增减:-1
+ 2024-06-27
+ 09:10:10
-
+
+ +20
- 时间:2023-11-02
-
+
+ 积分获取
- 积分余额:1000
-
-
- 兑换记录:123
-
-
- 兑换增减:-1
+ 2024-06-27
+ 09:10:10
-
+
+ +20
@@ -131,24 +131,57 @@
\ No newline at end of file
diff --git a/packages/order/order.vue b/packages/order/order.vue
index 8a9dede..76e40f5 100644
--- a/packages/order/order.vue
+++ b/packages/order/order.vue
@@ -1,5 +1,5 @@
-
+
@@ -12,18 +12,20 @@
{{cardInfo.sku?cardInfo.sku.name:''}}
-
+
+
{{cardInfo.sku?cardInfo.sku.specs:''}}
-
+
卡券状态
-
+
@@ -93,7 +95,7 @@
- 点击提货
+ {{type=='edit'?'点击修改':'点击提货'}}
@@ -105,7 +107,7 @@
-
+
{{cardInfo.sku?cardInfo.sku.name:''}}
{{cardInfo.sku?cardInfo.sku.specs:''}}
@@ -152,7 +154,7 @@
返回修改
- 确认提货
+ {{type=='edit'?'确认修改':'确认提货'}}
@@ -198,7 +200,8 @@
showAddress: false,
listAddress: [],
addressInfo: '',
- cardInfo: {},
+ cardInfo: {},
+ type:'',
form: {
card_number: '',
password: '',
@@ -282,28 +285,57 @@
this.$refs.uForm.setRules(this.rules);
},
- onLoad(option) {
- if (option.hasCard) {
- this.cardInfo = uni.getStorageSync("vuex_card") ? uni.getStorageSync("vuex_card").card : {}
- this.form.card_number = uni.getStorageSync("vuex_card") ? uni.getStorageSync("vuex_card").card_number : ''
- this.form.password = uni.getStorageSync("vuex_card") ? uni.getStorageSync("vuex_card").password : ''
- // uni.removeStorageSync("vuex_card")
+ onLoad(option) {
+ let that = this
+ if (option.hasCard) {
+ if(option.type=='edit'){
+ this.type = 'edit'
+ this.form = uni.getStorageSync("vuex_update_card") ? uni.getStorageSync("vuex_update_card") : {},
+ this.cardInfo = uni.getStorageSync("vuex_update_card") ? uni.getStorageSync("vuex_update_card") : {},
+ this.form.ymd = this.momentDay(this.form.send_date).ymd
+ uni.removeStorageSync("vuex_update_card")
+ uni.setNavigationBarTitle({
+ title: '修改订单',
+ success: function() {
+ console.log('标题设置成功');
+ that.showinfo = false
+ },
+ fail: function(err) {
+ console.error('标题设置失败', err);
+ }
+ });
+ console.log("this.form",this.form)
+ // uni.removeStorageSync("vuex_update_card")
+ }else{
+ this.cardInfo = uni.getStorageSync("vuex_card") ? uni.getStorageSync("vuex_card").card : {}
+ this.form.card_number = uni.getStorageSync("vuex_card") ? uni.getStorageSync("vuex_card").card_number : ''
+ this.form.password = uni.getStorageSync("vuex_card") ? uni.getStorageSync("vuex_card").password : ''
+ uni.removeStorageSync("vuex_card")
+ }
+
this.getAddress()
this.getDates()
+ this.getExpress()
this.getArea()
} else {
toast("未查询到卡券信息")
uni.removeStorageSync("vuex_card")
uni.redirectTo({
- url: '/pages/change/change'
+ url: '/packages/change/change'
})
}
},
methods: {
async getAddress() {
const res = await this.$u.api.getUserAddress()
- this.listAddress = res.address
- this.showAddress = this.listAddress.length > 0 ? true : false
+ this.listAddress = res.address
+ if(!this.type == 'edit'){
+ this.showAddress = this.listAddress.length > 0 ? true : false
+ }
+ },
+ async getExpress() {
+ const res = await this.$u.api.getExpress()
+ this.listExpress = res
},
changeAddress(e) {
console.log("e", e)
@@ -326,14 +358,18 @@
async getDates() {
await this.$u.api.getDates({
- card_number: this.form.card_number,
- password: this.form.password,
+ card_number: this.form.card_number
}).then(res => {
let data = res.card
if (data.open_dates) {
for (var k in data.open_dates) {
- let _k = this.momentDay(k)
- this.listDates.push(_k)
+ if (data.open_dates[k]['quantity'] - data.open_dates[k]['booked'] > 0) {
+ let _k = this.momentDay(k)
+ this.listDates.push({
+ canUse: data.open_dates[k],
+ ..._k
+ })
+ }
}
}
}).then(res => {
@@ -347,7 +383,7 @@
let ymd = this.$moment(date).format("M月DD日")
let week = weeks[this.$moment(date).day()]
const solar2lunarData = solarLunar.solar2lunar(dateArr[0], dateArr[1], dateArr[2]);
-
+
return {
date: date,
ymd: ymd,
@@ -362,7 +398,8 @@
if (e) {
this.form.send_date = e.date
this.form.ymd = e.ymd
- this.form.express = e.expressvalue
+ this.form.express = e.expressname
+ this.form.express_type_id = e.expressid
this.form.hh = e.hhtime
this.form.week = e.week
this.form.lunarData = e.lunarData
@@ -465,19 +502,38 @@
city_id: this.form.city_id,
district_id: this.form.district_id,
defalut: 1
+ }).then(res => {
+ if(this.type=='edit'){
+ uni.redirectTo({
+ url: '/packages/myorder/myorder'
+ })
+ }else{
+ uni.redirectTo({
+ url: '/packages/product/public'
+ })
+ }
+
}).then(res => {
- uni.redirectTo({
- url: '/packages/myorder/myorder'
- })
- }).then(res => {
- uni.redirectTo({
- url: '/packages/myorder/myorder'
- })
+ if(this.type=='edit'){
+ uni.redirectTo({
+ url: '/packages/myorder/myorder'
+ })
+ }else{
+ uni.redirectTo({
+ url: '/packages/product/public'
+ })
+ }
})
} else {
- uni.redirectTo({
- url: '/packages/myorder/myorder'
- })
+ if(this.type=='edit'){
+ uni.redirectTo({
+ url: '/packages/myorder/myorder'
+ })
+ }else{
+ uni.redirectTo({
+ url: '/packages/product/public'
+ })
+ }
}
},
@@ -509,21 +565,40 @@
}
});
} else {
- this.form.show = 0
- this.$u.api.addUserOrder(this.form).then(res => {
- console.log("res", res)
- uni.removeStorageSync('vuex_card')
- toast(res.msg, 1000, function() {
- setTimeout(function() {
- that.saveDefalutAddress()
- }, 500)
-
- })
-
- }).then(res => {
- console.log('res1', res)
-
- })
+ this.form.show = 0
+ if(this.type=='edit'){
+ console.log("this.form",this.form)
+ // return
+ this.$u.api.saveUserOrder(this.form).then(res => {
+ uni.removeStorageSync('vuex_update_card')
+ toast(res.msg, 1000, function() {
+ setTimeout(function() {
+ that.saveDefalutAddress()
+ }, 500)
+
+ })
+
+ }).then(res => {
+ console.log('res1', res)
+
+ })
+ }else{
+ this.$u.api.addUserOrder(this.form).then(res => {
+ console.log("res", res)
+ uni.removeStorageSync('vuex_card')
+ toast(res.msg, 1000, function() {
+ setTimeout(function() {
+ that.saveDefalutAddress()
+ }, 500)
+
+ })
+
+ }).then(res => {
+ console.log('res1', res)
+
+ })
+ }
+
}
} else {
@@ -539,7 +614,7 @@
\ No newline at end of file
diff --git a/pages.json b/pages.json
index 7b9aefb..698c8fb 100644
--- a/pages.json
+++ b/pages.json
@@ -12,86 +12,87 @@
"style": {
"navigationStyle": "custom"
}
- },{
+ }, {
"path": "pages/talk/talk",
"style": {
"navigationBarTitleText": "客服"
}
- }, {
- "path": "pages/change/change",
- "style": {
- "navigationBarTitleText": "兑换"
- }
}],
"subPackages": [{
"root": "packages",
"pages": [{
- "path": "order/order",
- "style": {
- "navigationBarTitleText": "填写订单"
- }
- }, {
- "path": "myorder/myorder",
- "style": {
- "navigationBarTitleText": "我的订单"
- }
- },
- {
- "path" : "myorder/infoconfirm",
- "style": {
- "navigationBarTitleText": "订单详情"
- }
- },{
- "path": "card/index",
- "style": {
- "navigationBarTitleText": "卡券查询"
- }
- }, {
- "path": "card/detail",
- "style": {
- "navigationBarTitleText": "卡券详情"
- }
- }, {
- "path": "product/index",
- "style": {
- "navigationBarTitleText": "铂金商品"
- }
- }, {
- "path": "product/offline",
- "style": {
- "navigationBarTitleText": "线下商品"
- }
- }, {
- "path": "product/fresh",
- "style": {
- "navigationBarTitleText": "生鲜商品"
- }
- }, {
- "path": "product/public",
- "style": {
- "navigationBarTitleText": "领取积分"
- }
- }, {
- "path": "my/address",
- "style": {
- "navigationBarTitleText": "我的地址"
- }
- }, {
- "path": "my/addaddress",
- "style": {
- "navigationBarTitleText": "我的地址"
- }
- }, {
- "path": "my/score",
- "style": {
- "navigationBarTitleText": "我的积分"
- }
- }, {
- "path": "my/feedback",
- "style": {
- "navigationBarTitleText": "我的积分"
+ "path": "change/change",
+ "style": {
+ "navigationBarTitleText": "兑换"
+ }
+ }, {
+ "path": "order/order",
+ "style": {
+ "navigationBarTitleText": "填写订单"
+ }
+ }, {
+ "path": "myorder/myorder",
+ "style": {
+ "navigationBarTitleText": "我的订单"
+ }
+ },
+ {
+ "path": "myorder/infoconfirm",
+ "style": {
+ "navigationBarTitleText": "订单详情"
+ }
+ }, {
+ "path": "card/index",
+ "style": {
+ "navigationBarTitleText": "卡券查询"
+ }
+ }, {
+ "path": "card/detail",
+ "style": {
+ "navigationBarTitleText": "卡券详情"
+ }
+ }, {
+ "path": "product/index",
+ "style": {
+ "navigationBarTitleText": "铂金商品"
+ }
+ }, {
+ "path": "product/offline",
+ "style": {
+ "navigationBarTitleText": "线下商品"
+ }
+ }, {
+ "path": "product/fresh",
+ "style": {
+ "navigationBarTitleText": "生鲜商品"
+ }
+ }, {
+ "path": "product/public",
+ "style": {
+ "navigationBarTitleText": "领取积分"
+ }
+ }, {
+ "path": "my/address",
+ "style": {
+ "navigationBarTitleText": "我的地址"
+ }
+ }, {
+ "path": "my/addaddress",
+ "style": {
+ "navigationBarTitleText": "填写地址"
+ }
+ }, {
+ "path": "my/score",
+ "style": {
+ "navigationBarTitleText": "我的积分"
+ }
+ }, {
+ "path": "my/feedback",
+ "style": {
+ "navigationBarTitleText": "我的积分"
+ }
}
- }]
+ ]
}],
"preloadRule": {
diff --git a/pages/home/home.vue b/pages/home/home.vue
index 60ca17d..c25bf85 100644
--- a/pages/home/home.vue
+++ b/pages/home/home.vue
@@ -31,7 +31,7 @@