diff --git a/uniapp05/API/api.ts b/uniapp05/API/api.ts index c1766ef..c45a448 100644 --- a/uniapp05/API/api.ts +++ b/uniapp05/API/api.ts @@ -1 +1,2 @@ -export const apiImageUrl = 'http://39.101.78.35:6271' // 测试服务器 \ No newline at end of file +export const apiImageUrl = 'http://39.101.78.35:6271' +//export const apiImageUrl = 'http://localhost:9999' \ No newline at end of file diff --git a/uniapp05/API/requets.ts b/uniapp05/API/requets.ts deleted file mode 100644 index ef6ca3b..0000000 --- a/uniapp05/API/requets.ts +++ /dev/null @@ -1,52 +0,0 @@ - - -// 定义公共的url -//const baseUrl = "https://xiaode.shop:8066/api"; -//const webSocketUrl = "wss://xiaode.shop:8066/api/ws/" - - -const baseUrl = "http://110.42.248.235:8066/api"; -const webSocketUrl = "ws://110.42.248.235:8066//api/ws/" -/** - * 返回baseUrl - */ -export const getBaseUrl = () => { - return baseUrl; -} -export const getSocketUrl = () => { - return webSocketUrl; -} -/** - * 后端请求工具类 - * @param {*} params 请求参数 - */ -export const requestUtil = (params:any) => { - - let header = { ...params.header }; - - // 拼接header 带上token - header["token"] = uni.getStorageSync("cookie"); - - - - - return new Promise((resolve, reject) => { - uni.request({ - ...params, - method:params.method, - header: header, - url: baseUrl + params.url, - success: (result:any) => { - resolve(result.data); - }, - fail: (err:any) => { - uni.showToast({ - icon: 'error', - title: '连接服务器失败', - duration: 3000 - }) - reject(err); - } - }); - }) -} diff --git a/uniapp05/pages.json b/uniapp05/pages.json index 9a8b931..ce8bbf5 100644 --- a/uniapp05/pages.json +++ b/uniapp05/pages.json @@ -174,6 +174,31 @@ "enablePullDownRefresh" : false, "navigationBarBackgroundColor": "#4095e5" } + }, + { + "path" : "pages/testone/testone", + "style" : + { + "navigationBarTitleText" : "", + "enablePullDownRefresh" : false + } + }, + { + "path" : "pages/testfour/testfour", + "style" : + { + "navigationBarTitleText" : "测试页四", + "enablePullDownRefresh" : false + } + }, + { + "path" : "pages/three/three", + "style" : + { + "navigationBarTitleText" : "订单", + "enablePullDownRefresh" : false, + "navigationBarBackgroundColor": "#4095e5" + } } ], "globalStyle": { diff --git a/uniapp05/pages/distribution/distribution.vue b/uniapp05/pages/distribution/distribution.vue index 87940be..b7f7d45 100644 --- a/uniapp05/pages/distribution/distribution.vue +++ b/uniapp05/pages/distribution/distribution.vue @@ -1,76 +1,148 @@ +22.42 \ No newline at end of file diff --git a/uniapp05/pages/index/index.vue b/uniapp05/pages/index/index.vue index ed120c8..6ed2117 100644 --- a/uniapp05/pages/index/index.vue +++ b/uniapp05/pages/index/index.vue @@ -1,28 +1,54 @@ \ No newline at end of file diff --git a/uniapp05/pages/my/my.vue b/uniapp05/pages/my/my.vue index c9896e5..471e4b2 100644 --- a/uniapp05/pages/my/my.vue +++ b/uniapp05/pages/my/my.vue @@ -87,7 +87,9 @@ const getLoginUser = () => { }, data: {}, success: (res) => { - console.log(res.data.message)//控制台在登录时返回ok未登录时返回”未登录“ + console.log(res.data.data.id) + uni.setStorageSync('businessId', res.data.data.id); + console.log(res.data.data); user.value.message=res.data.message if(user.value.message==='ok') { @@ -132,57 +134,53 @@ const logout = () => { }); }; +const avatarUrl = uni.getStorageSync('avatarUrl') || ''; +const username = uni.getStorageSync('username') || ''; +const phone = uni.getStorageSync('phone') || ''; +const userId = uni.getStorageSync('id') || ''; +const businessId = uni.getStorageSync('businessId') || ''; +const storeStatus = ref(0); - -/* const handleSwitchChange = (value) => { - const storeStatus = value ? 1 : 0; - console.log(storeStatus+"值为"); */ +const handleSwitchChange = () => { + storeStatus.value = storeStatus.value === 0 ? 1 : 0; + console.log('当前状态:', storeStatus.value); - // 初始化状态 - const [storeStatus, setStoreStatus] = useState(0); - - // 定义handleSwitchChange函数 - const handleSwitchChange = (value) => { - const newStoreStatus = value ? 1 : 0; - setStoreStatus(newStoreStatus); // 更新状态 - console.log(`storeStatus值为: ${newStoreStatus}`); - - -/* const data = { + const data = { address: '', - businessAvatar: 'https://tse4-mm.cn.bing.net/th/id/OIP-C.vNYHZ0vsWMLi4nfLG4rWEwHaE7?rs=1&pid=ImgDetMain', - businessImages: 'https://tse4-mm.cn.bing.net/th/id/OIP-C.vNYHZ0vsWMLi4nfLG4rWEwHaE7?rs=1&pid=ImgDetMain', - businessName: '麻辣烫', - businessPhone: '', + businessAvatar:avatarUrl, + businessImages: avatarUrl, + businessName: username, + businessPhone: phone, + /* businessAvatar:'https://tse2-mm.cn.bing.net/th/id/OIP-C.wq-7irlVpAizKGvyvO0BNQHaFj?rs=1&pid=ImgDetMain', + businessImages: 'https://tse2-mm.cn.bing.net/th/id/OIP-C.wq-7irlVpAizKGvyvO0BNQHaFj?rs=1&pid=ImgDetMain', + businessName: '麻辣烫', + businessPhone: '13613639360', */ businessProfile: '', categoryId: 0, endBusiness: '', - id: 1830063677349658625, + id: businessId, startBusiness: '', state: 0, - storeStatus: 1, - userId: 0 + storeStatus: storeStatus.value, + userId: userId }; uni.request({ url:apiImageUrl+'/api/business/update/my', - method:'POST', - header: { - 'content-type': 'application/json' - }, - data: data, - - success(res) { - console.log('Success:', res.data); - }, - fail() { - console.error('Error:', error); - } - }) */ - - - -}; + method:'POST', + header: { + 'content-type': 'application/json' + }, + data: data, + + success(res) { + console.log('Success:', res.data); + }, + fail() { + console.error('Error:', error); + } + }) +}; diff --git a/uniapp05/pages/orderManagement/orderManagement.vue b/uniapp05/pages/orderManagement/orderManagement.vue index 164586b..438543b 100644 --- a/uniapp05/pages/orderManagement/orderManagement.vue +++ b/uniapp05/pages/orderManagement/orderManagement.vue @@ -1,5 +1,5 @@