-
- {{isType ? '店铺类型说明' : '商户入驻协议'}}
-
-
-
-
+
+
+
+
+
+
+ 商家入驻
-
-
+
+
+
+
+
+
+
+
+ {{isType ? '店铺类型说明' : '商户入驻协议'}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{detail.title}}
+ 甲方公司:{{company?company:"暂无公司信息"}}
+ 机构代码:{{organization_code?organization_code:"暂无公司信息"}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
- 恭喜,您的资料提交成功!
- 预计15个工作日内审核完毕,平台客服会及时与您联系!
-
- 返回首页
+
+
+
+ 恭喜,您的资料提交成功!
+ 预计15个工作日内审核完毕,平台客服会及时与您联系!
+
+ 返回首页
+
@@ -130,7 +313,7 @@
// +----------------------------------------------------------------------
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
// +----------------------------------------------------------------------
- // | Copyright (c) 2016~2023 https://www.crmeb.com All rights reserved.
+ // | Copyright (c) 2016~2021 https://www.crmeb.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
// +----------------------------------------------------------------------
@@ -140,32 +323,56 @@
create,
verify,
merClassifly,
+ getCategoryList,
getGoodsDetails,
updateGoodsRecord,
- getStoreTypeApi
+ getStoreTypeApi,
+ agreeiness,
+ merchantLicenseIdentify
} from '@/api/store.js';
import {
getCaptcha,
- getAgreementApi
+ getAgreementApi,
+ merstreet
} from "@/api/user";
- import { mapGetters } from "vuex";
- import { configMap } from "@/utils";
+ import {
+ getStreet,
+ getArea,
+ getVillage
+ } from "@/api/article.js"
+ import {
+ mapGetters
+ } from "vuex";
+ import {
+ configMap
+ } from "@/utils";
+ import {
+ intention,
+ } from "@/api/product"
import parser from "@/components/jyf-parser/jyf-parser";
- import Verify from '@/components/verify/verify.vue';
- import { toLogin } from '@/libs/login.js';
- import { HTTP_REQUEST_URL } from '@/config/app';
+ import authorize from '@/components/Authorize';
+ import Verify from '@/components/verify/verify.vue';
+ import {
+ HTTP_REQUEST_URL
+ } from '@/config/app';
+import { Toast } from '../../../libs/uniApi';
const app = getApp();
export default {
components: {
"jyf-parser": parser,
- Verify
+ authorize,
+ Verify
},
data() {
return {
+ company: '',
+ organization_code: '',
domain: HTTP_REQUEST_URL,
cartId: '', //购物车id
pinkId: 0, //拼团id
couponId: 0, //优惠券id
+ isAuto: false, //没有授权的不会自动授权
+ isShowAuth: false, //是否隐藏授权
text: "获取验证码",
codeUrl: "",
disabled: false,
@@ -173,12 +380,18 @@
showProtocol: false,
isShowCode: false,
loading: false,
+ isshow: false,
merchantData: {
enterprise_name: "",
user_name: "",
phone: "",
- classification: ''
+ classification: '',
+ social_credit_code: '',
+ company_name: '',
+ address: '',
+ invitation_code: '',
},
+ business_license: '',//营业执照
validate: false,
successful: false,
keyCode: "",
@@ -187,34 +400,65 @@
timer: "",
index: 0,
index1: 0,
+ index2: [0, 0, 0],
mer_classification: "",
+ nature_business: 0,
array: [{
category_name: '',
merchant_category_id: ''
}],
+ companyTypeList: ['对公户', '个体户'],
+ bindPickerChangeidx: [],
storeTypeArr: [{
type_name: '',
mer_type_id: ''
}],
+ StreetTyoeArr: [{
+ area_id: '',
+ street_id: '',
+ village_id: ''
+ }],
mer_storeType: '',
+ area_id: '',
+ street_id: '',
+ village_id: '',
+ isnm: false,
+ isnum: 0,
+ code1: '',
+ code2: '',
+ business_name: '',
+ business: [],
pics: [],
tagStyle: {
img: 'width:100%;display:block;'
},
mer_i_id: null, // 商户申请id
isType: false,
+ num: 10,
+ detail: {},
+ statusBarHeight: 0,
+ where: {
+ type: 1,
+ page: 1,
+ limit: 10
+ },
+ codenote: []
};
},
beforeDestroy() {
clearTimeout(this.timer)
},
- computed: configMap({sys_intention_agree:''},mapGetters(['isLogin','viewColor','keyColor'])),
+ computed: configMap({
+ sys_intention_agree: ''
+ }, mapGetters(['isLogin', 'viewColor', 'keyColor'])),
onLoad(options) {
+
if (this.isLogin) {
this.getClassfication();
this.getStoreType();
} else {
- toLogin()
+ this.isAuto = true;
+ this.isShowAuth = true
}
if (options.mer_i_id) {
this.mer_i_id = options.mer_i_id
@@ -225,10 +469,133 @@
this.getGoodsDetails(options.mer_i_id)
})
}
+ else this.getArea()
+ this.statusBarHeight = uni.getSystemInfoSync().statusBarHeight + 45;
+ },
+ onShow() {
+
},
- onShow() {},
onReady() {},
methods: {
+ //获取交易信息
+ codelist() {
+ intention(this.where).then(res => {
+ this.codenote = res.data.list
+ })
+ },
+ //退出
+ logout() {
+ uni.switchTab({
+ url: '/pages/user/index'
+ })
+ },
+ //关闭弹窗
+ recuo() {
+ if (this.num > 0) {
+ this.num = 10
+ this.isshow = false
+ } else {
+ this.num = 10
+ this.isshow = false
+ }
+ },
+ //拒绝
+ refuse() {
+
+
+ uni.switchTab({
+ url: '/pages/user/index'
+ })
+ },
+ countDown() {
+ let {
+ num
+ } = this;
+ // if (num === 3) this.nums = true;
+ num = num > 0 ? num - 1 : "0";
+ setTimeout(() => {
+
+ this.num = num;
+ if (num == '0') {
+ // this.launchApp()
+ return
+ }
+ if (this.isshow == false && this.num > 0) {
+ this.num = 10
+ return
+ }
+ this.countDown();
+ }, 1000);
+
+
+ },
+
+ //获取商户入驻申请协议
+ shoplist(val) {
+
+ agreeiness({
+ type: val
+ }).then(res => {
+ this.detail = res.data
+ })
+ },
+
+
+ //是否是农贸市场
+ // change(e) {
+ // this.isnum = (e === true ? 1 : 0)
+ // },
+ // 获取村
+ getVillage(e) {
+ const self = this;
+ getVillage({
+ street_code: e
+ }).then(res => {
+ self.$set(self.business, 2, res.data);
+ if(self.mer_i_id&&!this.business_name){
+ let area = self.business[0].find(item=>item.code==self.area_id)?.name;
+ let street = self.business[1].find(item=>item.code==self.street_id)?.name;
+ let village = self.business[2].find(item=>item.id==self.village_id)?.name;
+ this.business_name = `${area} ${street} ${village}`;
+ this.getArea();
+ }
+ })
+ },
+ //获取镇
+ getStreet(e, street) {
+ const self = this;
+ getStreet({
+ area_code: e
+ }).then(res => {
+ self.$set(self.business, 1, res.data)
+ self.getVillage(street?street:self.business[1][0].code)
+ })
+ },
+ //获取区
+ getArea(code=null, street=null) {
+ getArea({
+ city_code: 510500
+ }).then(res => {
+ this.business[0] = res.data;
+ this.code1 = code ? code : this.business[0][0].code;
+ this.getStreet(this.code1, street)
+ })
+ },
+ //商圈数据变化
+ pickerColumnchange(e) {
+ if (e.detail.column === 0) {
+ this.getStreet(this.business[0][e.detail.value].code)
+ this.index2[0] = e.detail.value
+ this.index2[1] = 0
+ this.index2[2] = 0
+ } else if (e.detail.column === 1) {
+ this.getVillage(this.business[1][e.detail.value].code)
+ this.index2[1] = e.detail.value
+ this.index2[2] = 0
+ } else if (e.detail.column === 1) {
+ this.index2[2] = e.detail.value
+ }
+ },
getConfig() {
this.isType = false;
this.showProtocol = true;
@@ -242,6 +609,8 @@
that.isType = true
getAgreementApi('sys_merchant_type').then(res => {
that.protocol = res.data.sys_merchant_type
+
+
})
},
// 获取历史提交数据详情
@@ -253,12 +622,29 @@
this.merchantData.enterprise_name = resData.mer_name
this.merchantData.user_name = resData.name
this.merchantData.phone = resData.phone
+ this.merchantData.social_credit_code = resData.social_credit_code
+ this.merchantData.company_name = resData.company_name
+ this.merchantData.address = resData.address
+ this.merchantData.invitation_code = resData.invitation_code
this.merchantData.classification = resData.merchant_category_id
this.merchantData.mer_type = resData.mer_type_id
+ this.area_id = resData.area_id
+ this.street_id = resData.street_id
+ this.mer_storeType = resData.mer_storeType
+ this.village_id = resData.village_id
})
- this.pics = resData.images
+ this.business_license = resData.images[0];
+ resData.images.shift();
+ this.pics = resData.images;
this.mer_classification = this.getCategoryName(resData.merchant_category_id, this.array)
this.mer_storeType = this.getStoreTypeName(resData.mer_type_id, this.storeTypeArr)
+ this.business_name = '';
+ this.getArea(this.area_id, this.street_id);
+ if(resData.mer_type_id!=12){
+ this.shoplist('mer_services_agree')
+ }else{
+ this.shoplist('mer_supply_agree')
+ }
uni.hideLoading();
})
},
@@ -278,20 +664,71 @@
}
}
},
+ // 选择公司性质
+ natureBusinessChange(e){
+ this.nature_business = this.companyTypeList[e.detail.value]=='个体户'?2:1;
+ },
bindPickerChange: function(e) {
- this.index = e.target.value
- let idx = e.target.value
- this.merchantData.classification = this.array[idx]['merchant_category_id']
- this.mer_classification = this.array[idx]['category_name']
+ // console.log(e.detail);
+ // this.index = e.target.value[1];
+ let idx = e.target.value;
+ // let idx = e.target.value[1];
+ this.merchantData.classification = this.array[idx]['merchant_category_id']
+ this.mer_classification = this.array[idx]['category_name']
+ // this.merchantData.classification = this.bindPickerChangeidx[idx]['store_category_id']
+ // this.mer_classification = this.bindPickerChangeidx[idx]['cate_name']
this.validateBtn()
},
+ columnchange(e){
+ // console.log(e.detail);
+ if(e.detail.column==0){
+ this.bindPickerChangeidx = this.array[e.detail.value].children;
+ }
+ },
bindPickerChange1: function(e) {
+
this.index1 = e.target.value
let idx = e.target.value
this.merchantData.mer_type = this.storeTypeArr[idx]['mer_type_id']
this.mer_storeType = this.storeTypeArr[idx]['type_name']
+ // console.log(this.merchantData.mer_type)
+ if(this.storeTypeArr[idx]['type_code']== 'TypeStore'&&this.merchantData.mer_type){
+ this.shoplist('mer_services_agree')
+ }else{
+ this.shoplist('mer_supply_agree')
+ }
this.validateBtn()
},
+
+ bindPickerChange2: function(e) {
+ // console.log(e.detail.value)
+ this.index2 = e.detail.value
+ this.business_name =
+ `${this.business[0][this.index2[0]].name} ${this.business[1][this.index2[1]].name} ${this.business[2][this.index2[2]].name}`
+ this.area_id = this.business[0][this.index2[0]].code
+ this.street_id = this.business[1][this.index2[1]].code
+ this.village_id = this.business[2][this.index2[2]].id
+ if(this.merchantData.mer_type==12) return ; //市级供应链不需要查询镇农科公司
+ merstreet({
+ street_code: this.street_id
+ }).then((res) => {
+ if (res.code == 0) {
+ this.company = ''
+ this.organization_code = ''
+ this.$util.Tips({
+ title: res.msg
+ });
+ return false;
+ } else {
+ this.company = res.data.title
+ this.organization_code = res.data.organization_code
+ }
+
+
+ }).catch(res => {
+ console.log(res)
+ })
+ },
// 获取商户分类
getClassfication: function() {
merClassifly()
@@ -303,11 +740,27 @@
title: res
});
});
+ // getCategoryList()
+ // .then(res => {
+ // // console.log(res);
+ // res.data.list.forEach(item=>{
+ // item.category_name = item.cate_name;
+ // item.merchant_category_id = item.store_category_id;
+ // })
+ // this.array = res.data.list;
+ // this.bindPickerChangeidx = this.array[0].children;
+ // })
+ // .catch(res => {
+ // this.$util.Tips({
+ // title: res
+ // });
+ // });
},
// 获取店铺类型
getStoreType: function() {
getStoreTypeApi()
.then(res => {
+
this.storeTypeArr = res.data
})
.catch(res => {
@@ -333,6 +786,14 @@
});
}
},
+ // 授权回调
+ onLoadFun: function() {
+ this.isShowAuth = false;
+ },
+ // 授权关闭
+ authColse: function(e) {
+ this.isShowAuth = e
+ },
toggleTab(str) {
this.$refs[str].show();
},
@@ -356,6 +817,32 @@
that.$set(that, 'pics', that.pics);
});
},
+ /**
+ * 上传图片识别文字
+ *
+ */
+ uploadpicText: function() {
+ let that = this;
+ that.$util.uploadImageOne('upload/image', function(res) {
+ that.business_license = res.data.path;
+ uni.showLoading({
+ title: '识别中'
+ })
+ merchantLicenseIdentify({
+ image: res.data.path
+ }).then(res=>{
+ that.merchantData.address = res.data.address;
+ that.merchantData.user_name = res.data.legal_person;
+ that.merchantData.social_credit_code = res.data.register_number;
+ that.merchantData.company_name = res.data.name;
+ // that.$set('merchantData', that.merchantData);
+ uni.hideLoading();
+ }).catch((e)=>{
+ uni.hideLoading();
+ Toast(e)
+ })
+ });
+ },
/**
* 删除图片
*
@@ -391,8 +878,8 @@
// key: that.codeKey,
// code: that.codeVal,
type: 'intention',
- captchaType: 'blockPuzzle',
- captchaVerification: data.captchaVerification
+ captchaType: 'blockPuzzle',
+ captchaVerification: data.captchaVerification
})
.then(res => {
that.$util.Tips({
@@ -442,60 +929,164 @@
this.isAgree = !this.isAgree;
this.validateBtn();
},
- formSubmit: function(e) {
- let that = this;
- if (that.validateForm() && that.validate) {
- let requestData = {
- phone: that.merchantData.phone,
- mer_name: that.merchantData.enterprise_name,
- name: that.merchantData.user_name,
- code: that.merchantData.yanzhengma,
- merchant_category_id: that.merchantData.classification,
- mer_type_id: that.merchantData.mer_type,
- images: that.pics
- }
- that.validate = false;
- if (that.mer_i_id) {
- updateGoodsRecord(that.mer_i_id, requestData).then(res => {
- if (res.status == 200) {
- title: '提交成功',
- that.loading = true;
- that.timer = setTimeout(() => {
- that.successful = true;
- that.validate = true;
- }, 1000)
- }
- }).catch(res => {
- that.validate = true;
- that.$util.Tips({
- title: res
- });
- })
- } else {
- create(requestData).then(data => {
- if (data.status == 200) {
- title: '提交成功',
- that.loading = true;
- this.timer = setTimeout(() => {
- that.successful = true;
- that.validate = true;
- }, 1000)
- }
+ //所属公司
- }).catch(res => {
- that.validate = true;
- that.$util.Tips({
- title: res
- });
- })
+
+ //协议弹窗
+ showxy() {
+ this.isshow = true
+ },
+ //提交
+ agree() {
+ let that = this;
+ let requestData = {
+ phone: that.merchantData.phone,
+ mer_name: that.merchantData.enterprise_name,
+ name: that.merchantData.user_name,
+ code: that.merchantData.yanzhengma,
+ company_name: that.merchantData.company_name,
+ address: that.merchantData.address,
+ invitation_code: that.merchantData.invitation_code,
+ social_credit_code: that.merchantData.social_credit_code,
+ merchant_category_id: that.merchantData.classification,
+ merchant_category_name: that.mer_classification,
+ is_company: that.nature_business==1?1:0, // 是否是公司, 1是公司, 0是个体
+ mer_type_id: that.merchantData.mer_type,
+ mer_storeType: this.mer_storeType,
+ area_id: this.area_id,
+ street_id: this.street_id,
+ village_id: this.village_id,
+ is_nmsc: this.isnum,
+ images: [this.business_license, ...that.pics]
+ }
+ that.validate = false;
+ if (that.mer_i_id) {
+ updateGoodsRecord(that.mer_i_id, requestData).then(res => {
+ if (res.status == 200) {
+ title: '提交成功',
+ that.loading = true;
+ that.timer = setTimeout(() => {
+ that.successful = true;
+ that.validate = true;
+ }, 1000)
+ }
+ }).catch(res => {
+ this.isshow = false
+ that.validate = true;
+ that.$util.Tips({
+ title: res
+ });
+ })
+ } else {
+ create(requestData).then(data => {
+ if (data.status == 200) {
+ title: '提交成功',
+ that.loading = true;
+ this.timer = setTimeout(() => {
+ that.successful = true;
+ that.validate = true;
+ }, 1000)
+ }
+ }).catch(res => {
+ this.isshow = false
+ that.validate = true;
+ that.$util.Tips({
+ title: res
+ });
+ })
+ }
+ },
+ formSubmit() {
+ if (this.validateForm() && this.validate) {
+ if (this.merchantData.mer_type == '12') return this.agree();
+ if (this.codenote.length == 0) {
+ this.isshow = true
+ this.countDown()
+ } else {
+ if (this.codenote[0].status == 0) {
+ uni.showModal({
+ title: '申请正在审核中,请勿重复提交'
+ })
+ } else {
+ this.isshow = true
+ this.countDown()
+ }
}
}
+
+ // let that = this;
+ // if (that.validateForm() && that.validate) {
+ // if (this.num == 0) {
+ // let requestData = {
+ // phone: that.merchantData.phone,
+ // mer_name: that.merchantData.enterprise_name,
+ // name: that.merchantData.user_name,
+ // code: that.merchantData.yanzhengma,
+ // company_name: that.merchantData.company_name,
+ // address: that.merchantData.address,
+ // social_credit_code: that.merchantData.social_credit_code,
+ // merchant_category_id: that.merchantData.classification,
+ // mer_type_id: that.merchantData.mer_type,
+ // mer_storeType: this.mer_storeType,
+ // area_id: this.area_id,
+ // street_id: this.street_id,
+ // village_id: this.village_id,
+ // is_nmsc: this.isnum,
+ // images: that.pics
+ // }
+ // that.validate = false;
+ // if (that.mer_i_id) {
+ // updateGoodsRecord(that.mer_i_id, requestData).then(res => {
+ // if (res.status == 200) {
+ // title: '提交成功',
+ // that.loading = true;
+ // that.timer = setTimeout(() => {
+ // that.successful = true;
+ // that.validate = true;
+ // }, 1000)
+ // }
+ // }).catch(res => {
+ // this.isshow = false
+ // that.validate = true;
+ // that.$util.Tips({
+ // title: res
+ // });
+ // })
+ // } else {
+ // create(requestData).then(data => {
+ // if (data.status == 200) {
+ // title: '提交成功',
+ // that.loading = true;
+ // this.timer = setTimeout(() => {
+ // that.successful = true;
+ // that.validate = true;
+ // }, 1000)
+ // }
+
+ // }).catch(res => {
+ // that.validate = true;
+ // that.$util.Tips({
+ // title: res
+ // });
+ // })
+ // }
+ // } else {
+ // this.isshow = true
+ // this.countDown()
+ // }
+
+ // }
+
+
+
},
validateBtn: function() {
let that = this,
value = that.merchantData;
- if (value.enterprise_name && value.user_name && value.phone && /^1(3|4|5|7|8|9|6)\d{9}$/i.test(value.phone) &&
- value.yanzhengma && that.isAgree && value.classification) {
+ if (value.enterprise_name && value.user_name && value.phone && /^1(3|4|5|7|8|9|6)\d{9}$/i.test(
+ value
+ .phone) &&
+ value.yanzhengma && that.isAgree && this.mer_classification) {
if (!that.isShowCode) {
that.validate = true;
} else {
@@ -505,7 +1096,7 @@
that.validate = false;
}
}
- }else{
+ } else {
that.validate = false;
}
},
@@ -515,6 +1106,15 @@
if (!value.enterprise_name) return that.$util.Tips({
title: '请输入企业名称'
});
+ if (!value.social_credit_code) return that.$util.Tips({
+ title: '请输入统一社会信用代码'
+ });
+ if (!value.company_name) return that.$util.Tips({
+ title: '请输入公司名称'
+ });
+ if (!value.address) return that.$util.Tips({
+ title: '请输入详细地址'
+ });
if (!value.user_name) return that.$util.Tips({
title: '请输入姓名'
});
@@ -527,15 +1127,32 @@
if (!value.yanzhengma) return that.$util.Tips({
title: '请填写验证码'
});
- if (!value.classification) return that.$util.Tips({
+ if (!this.mer_classification) return that.$util.Tips({
title: '请选择商户分类'
});
+ if (!this.nature_business) return that.$util.Tips({
+ title: '请选择公司性质'
+ })
+ if (!this.mer_storeType) return that.$util.Tips({
+ title: '请选择店铺类型'
+ })
+ if (!this.business_name) return that.$util.Tips({
+ title: '请选择店铺所在地'
+ })
if (!that.isAgree) return that.$util.Tips({
title: '请勾选并同意入驻协议'
});
if (that.isShowCode && !that.codeVal) return that.$util.Tips({
title: '请填写图片验证码'
});
+ if (!that.business_license) return that.$util.Tips({
+ title: '请上传营业执照'
+ });
+ // if (that.pics.length == 0) return that.$util.Tips({
+ // title: '请上传一张或者多张图片'
+ // });
+
+
that.validate = true;
return true;
},
@@ -544,7 +1161,7 @@
url: "/pages/store/applicationRecord/index"
})
},
- success(data) {
+ success(data) {
this.$refs.verify.hide();
this.code(data);
},
@@ -552,6 +1169,7 @@
if (!this.merchantData.phone) return this.$util.Tips({
title: '请输入手机号'
});
+
if (!/^1(3|4|5|7|8|9|6)\d{9}$/i.test(this.merchantData.phone)) return this.$util.Tips({
title: '请输入正确的手机号码'
});
@@ -567,18 +1185,33 @@
+
+ .merchantsSettled .list .items {
+ padding: 50rpx 0 20rpx;
+ border-bottom: 1px solid #eee;
+ position: relative;
+ margin: 0 20px;
+
+ .uni-list-area {
+ height: 50px;
+ display: flex;
+ justify-content: flex-start;
+ align-items: center;
+
+ .uni-list-stree {
+ width: 30%;
+ margin-left: 10px;
+
+ .mer-area {
+ width: 100%;
+ border: 1px solid #C3C3C3;
+
+ picker {
+ display: flex;
+ }
+
+ input {
+ width: 100%;
+ font-size: 30rpx;
+
+ }
+ }
+ }
+ }
+
+ }
+
\ No newline at end of file
diff --git a/pages/store/settled/unit.vue b/pages/store/settled/unit.vue
index fa4249f..966bdbb 100644
--- a/pages/store/settled/unit.vue
+++ b/pages/store/settled/unit.vue
@@ -42,34 +42,7 @@
-
-
- 联系电话
-
-
-
-
-
- 验证码
-
-
-
-
-
-
- 验证码
-
-
-
-
-
-
+
@@ -226,10 +226,10 @@
增值电信营业许可证号:川B2-20221250
-
+
diff --git a/pages/users/user_money/index.vue b/pages/users/user_money/index.vue
index 20de582..ca61613 100644
--- a/pages/users/user_money/index.vue
+++ b/pages/users/user_money/index.vue
@@ -10,18 +10,18 @@
{{userInfo.now_money || 0}}
- 充值
+
- 充值
+
-
+
累计消费(元)
{{userInfo.total_consume || 0}}
@@ -42,12 +42,12 @@
消费记录
-
+
diff --git a/store/modules/app.js b/store/modules/app.js
index 4d0d51f..d79ff6c 100644
--- a/store/modules/app.js
+++ b/store/modules/app.js
@@ -20,6 +20,7 @@ import {
} from '../../config/cache';
const state = {
+ location: Cache.get('LOCATION_DATA', true) || {},
token: Cache.get(LOGIN_STATUS) || null,
uuid: uni.getStorageSync('uuid') || "",
backgroundColor: "#fff",
@@ -34,11 +35,19 @@ const state = {
};
const mutations = {
+ setLocation(state, data) {
+ state.location = data
+ Cache.set('LOCATION_DATA', data);
+ },
LOGIN(state, opt) {
state.token = opt.token;
Cache.set(LOGIN_STATUS, opt.token, opt.time);
uni.removeStorageSync('auth_token');
},
+ SET_USERINFO(state, opt){
+ state.userInfo = opt;
+ Cache.set(USER_INFO, opt);
+ },
SETUID(state,val){
state.uid = val;
Cache.set(UID, val);