hmp 4 yıl önce
ebeveyn
işleme
90eed384e2

+ 1 - 0
assets/http/api.js

@@ -36,6 +36,7 @@ const mall={
 
 //商户管理
 const shop={
+	myShop:p => http.get('shop/myShop',{params:p}),
 	submitAudit:p => http.post('/shop/submitAudit',p),
 	list:p => http.get('ldt_shop/shop/list',{params:p}),
 	detail:p => http.get('ldt_shop/shop/detail',{params:p}),

+ 6 - 6
assets/http/setting.js

@@ -1,13 +1,13 @@
 let setting = {}
 
-setting.baseURL='https://ldt.guosen-fumao.cn/api/'
-setting.webSocketUrl='wss://ldt.guosen-fumao.cn/websocket/'
-setting.enabledCrypto = true
-
-// setting.baseURL = 'http://192.168.1.168:2366/'
-// setting.webSocketUrl = 'ws://192.168.1.168:2366/websocket/'
+// setting.baseURL='https://ldt.guosen-fumao.cn/api/'
+// setting.webSocketUrl='wss://ldt.guosen-fumao.cn/websocket/'
 // setting.enabledCrypto = true
 
+setting.baseURL = 'http://192.168.1.168:2366/'
+setting.webSocketUrl = 'ws://192.168.1.168:2366/websocket/'
+setting.enabledCrypto = true
+
 // setting.baseURL = 'http://139.159.240.119:2366/'
 // setting.webSocketUrl = 'ws://139.159.240.119:2366/websocket/'
 // setting.enabledCrypto = true

+ 18 - 4
pages/index/index.vue

@@ -221,15 +221,15 @@
 				let params = {
 					personTel: phone,
 				}
-				let res = await this.$api.shop.list(params)
-				if (this.$isEmpty(res.data.records)) {
+				let res = await this.$api.shop.myShop(params)
+				if (this.$isEmpty(res.data)) {
 					this.$u.vuex('vuex_shopStatus', false)
 					return
 				}
 				if (this.$cache.get('defaultValue')) {
 					this.defaultValue = this.$cache.get('defaultValue')
 				}
-				this.shopList = res.data.records
+				this.shopList = res.data
 				let item = this.shopList[this.defaultValue[0]]
 				this.shopId = item.id
 				this.shopLable = item.name
@@ -270,8 +270,22 @@
 				this.$u.vuex('vuex_merchantNo', item.merchantNo)
 				this.$u.vuex('vuex_mallId', this.mallId)
 				this.$u.vuex('vuex_isOpenMember', item.isOpenMember == 1 ? true : false)
+				
+				this.cacheToken(item.tokenInfo)
 			},
-			shopConfirm(e) {
+			cacheToken(data){
+				let tokenInfo={
+					accessToken:data.access_token,
+					//提前200秒过期
+					expiresIn:new Date().getTime() + (data.expires_in - 200) * 1000,
+					refreshToken:data.refresh_token,
+					tenantId:data.tenant_id,
+					nickName:data.nick_name
+				}
+				this.$cache.put('token',data.access_token)
+				this.$cache.put("tokenInfo",tokenInfo)
+			},
+			async shopConfirm(e) {
 				this.shopId = e[0].value
 				this.shopLable = e[0].label
 				let item = this.shopList.filter((item, index) => {

+ 2 - 2
pages/shop-info/shop-info.vue

@@ -116,8 +116,8 @@
 							</u-form-item>
 						</view>
 						<view class="border">
-							<u-form-item label="具体地址" label-position="top" prop="address">
-								<u-input :border="false" disabled placeholder="请详细写到门店编号" v-model="form.address"></u-input>
+							<u-form-item label="店铺地址" label-position="top" prop="address">
+								<u-input :border="false" disabled placeholder="请选择店铺地址" v-model="form.address"></u-input>
 								<view slot="right">
 									<u-button @click="chooseAddress" size="mini">获取地址</u-button>
 								</view>