chenjj пре 1 дан
родитељ
комит
4d60881479

+ 3 - 0
App.vue

@@ -11,6 +11,8 @@ export default {
 		
 	},
 	onShow: function () {
+		//设置默认角色
+		 uni.setStorageSync('userType', 1);
 		console.log('App Show')
 	},
 	onHide: function () {
@@ -37,6 +39,7 @@ export default {
         }
     },
 	onMounted() { 
+		 
 		console.log("TCL: onMounted -> onMounted", onMounted)
 		
 	},

Разлика између датотеке није приказан због своје велике величине
+ 65 - 21
components/CustomTabBar/index.vue


+ 1 - 1
components/QRCode/index.vue

@@ -83,7 +83,7 @@ const handleLongPress = async () => {
 }
 
 onMounted(() => {
-  generateQRCode()
+  // generateQRCode()
 })
 </script>
 

+ 28 - 30
config.js

@@ -1,35 +1,33 @@
 // 应用全局配置
 const config = {
-  // baseUrl: 'https://vue.ruoyi.vip/prod-api',
-  //cloud后台网关地址
-  // baseUrl: 'http://192.168.100.139:9527', //嵘哥
-  // baseUrl: 'http://192.168.100.101:9527',//龙哥
-  baseUrl: 'http://192.168.100.122:9527',//东哥
-  // baseUrl: 'https://zybooks.tech/prod-api',
-  mapKey: 'KFEBZ-P2GKZ-A5PX4-7Q6Y7-KXOBF-XCB4C',
-  appName: '金邻助家',
-  // 应用信息
-  appInfo: {
-    // 应用名称
-    name: 'ruoyi-app-vue3',
-    // 应用版本
-    version: '1.1.0',
-    // 应用logo
-    logo: '/static/logo.png',
-    // 官方网站
-    site_url: 'http://ruoyi.vip',
-    // 政策协议
-    agreements: [
-      {
-        title: '隐私政策',
-        url: 'https://ruoyi.vip/protocol.html',
-      },
-      {
-        title: '用户服务协议',
-        url: 'https://ruoyi.vip/protocol.html',
-      },
-    ],
-  },
+	// baseUrl: 'https://vue.ruoyi.vip/prod-api',
+	//cloud后台网关地址
+	// baseUrl: 'http://192.168.100.110:9527',//嵘哥
+	// baseUrl: 'http://192.168.100.127:9527',//龙哥
+	baseUrl: 'https://goldshulin.com/prod-api',
+	mapKey:'KFEBZ-P2GKZ-A5PX4-7Q6Y7-KXOBF-XCB4C',
+	appName: '金邻助家',
+	// 应用信息
+	appInfo: {
+		// 应用名称
+		name: "ruoyi-app-vue3",
+		// 应用版本
+		version: "1.1.0",
+		// 应用logo
+		logo: "/static/logo.png",
+		// 官方网站
+		site_url: "http://ruoyi.vip",
+		// 政策协议
+		agreements: [{
+				title: "隐私政策",
+				url: "https://ruoyi.vip/protocol.html"
+			},
+			{
+				title: "用户服务协议",
+				url: "https://ruoyi.vip/protocol.html"
+			}
+		]
+	}
 }
 
 export default config

+ 10 - 6
pages/classify.vue

@@ -37,11 +37,7 @@ import NoneView from '@/components/NoneView/index.vue'
 import { userMainOrderList } from '@/api/userList.js'
 import CustomTabBar from '@/components/CustomTabBar/index.vue'
 import { wxMakePhoneCall } from '@/utils/wxRequest.js'
-const {
-  order_status,
-} = useDict('order_status', 'lrr_service_status')
-
-provide('order_status', order_status) //订单/服务状态
+import { getToken } from '@/utils/auth'
 
 const userType = uni.getStorageSync('userType') //读取本地存储
 const tab = ref('')
@@ -201,7 +197,15 @@ function onChange(tabItem) {
 }
 
 onMounted(() => {
-  // getList()
+  const token  = getToken();
+  if(token){
+    const {
+      order_status,
+    } = useDict('order_status', 'lrr_service_status')
+
+    provide('order_status', order_status) //订单/服务状态
+  }
+
 })
 
 onShow(() => {

+ 75 - 21
pages/index.vue

@@ -13,9 +13,60 @@
           <up-swiper :list="list3" indicator indicatorMode="line" circular :height="'554rpx'"></up-swiper>
         </view>
       </view>
-      <up-loadmore style="margin-top: 40rpx" :status="loadmoreInfo.status" :loadmoreText="loadmoreInfo.loadingText"
-        :loadingText="loadmoreInfo.loadmoreText" :nomoreText="loadmoreInfo.nomoreText" @loadmore="handleLoadmore"
-        v-if="userType == 1" />
+
+      <view class="home-grid">
+        <Client />
+      </view>
+
+      <view class="home-grid hot-box" v-if="userType === 1">
+        <view
+          v-for="(item, index) in hotList"
+          :key="index + 'hot'"
+          class="hot-item"
+        >
+          <img :src="item" alt="" style="width: 100%; height: 160rpx" />
+        </view>
+       
+      </view>
+       <view>
+          <up-notice-bar :text="text1"></up-notice-bar>
+        </view>
+
+      <view class="home-g-bgc">
+        <view class="home-grid2">
+          <view class="serve-title hot-box-title" v-if="userType === 1"
+            >超值专区</view
+          >
+          <view class="hot-swiper" v-if="ValueZone.length > 0">
+            <up-swiper
+              :list="ValueZone"
+              :indicator="false"
+              indicatorMode="line"
+              circular
+            ></up-swiper>
+          </view>
+        </view>
+
+        <view class="home-ranking home-grid2">
+      
+          <ServIces
+            :leftList="leftList"
+            :rightList="rightList"
+            v-if="userType === 1"
+          ></ServIces>
+          <RankingList v-if="userType === 2" />
+        </view>
+      </view>
+
+      <up-loadmore
+        style="margin-top: 40rpx"
+        :status="loadmoreInfo.status"
+        :loadmoreText="loadmoreInfo.loadingText"
+        :loadingText="loadmoreInfo.loadmoreText"
+        :nomoreText="loadmoreInfo.nomoreText"
+        @loadmore="handleLoadmore"
+        v-if="userType == 1"
+      />
     </view>
 
     <view class="Wrapper">
@@ -57,7 +108,7 @@ const leftList = ref([])
 const list3 = ref(['']) // Initialize with at least one empty item
 const ValueZone = ref(['']) // Initialize with at least one empty item
 const hotList = ref([])
-const userType = uni.getStorageSync('userType') //读取本地存储
+const userType = uni.getStorageSync('userType'); //读取本地存储
 const text1 = ref(
   '热烈祝贺:于5月20日上午9:00点钟召开"金邻助家"平台项目的首次发布会!'
 )
@@ -151,6 +202,8 @@ const getList = async () => {
     res.rows.forEach((item, index) => {
       index % 2 !== 0 ? leftList.value.push(item) : rightList.value.push(item)
     })
+    console.log('home',leftList.value,rightList.value);
+    
     pages.value.total = res.total
     if (pages.value.current >= Math.ceil(res.total / pages.value.pageSize)) {
       loadmoreInfo.value.status = 'nomore'
@@ -217,8 +270,8 @@ const settingAddress = async () => {
       latitude,
       longitude,
     }
+			console.log("TCL: settingAddress -> parmas", parmas);
     const res = await settingHomeAddress(parmas)
-    console.log('res', res)
     userType === 1 && getList()
   } catch (error) {
     console.log('设置地址失败', error)
@@ -232,7 +285,6 @@ onShow(() => {
   uni.getSystemInfo({
     success: (res) => {
       const statusBarHeight = res.statusBarHeight
-      console.log('res', res)
 
       const navBarHeight =
         res.platform === 'android' ? 48 : 44 + res.statusBarHeight
@@ -244,24 +296,26 @@ onShow(() => {
 const addresstree = ref([])
 
 onMounted(async () => {
-  const token = getToken()
-  if (token) {
+  
+  const token  = getToken();
+	console.log("TCL: token", token ||'null')
+  if(token){
     const res_dara = await regionAddresstree()
     addresstree.value = res_dara.data
     locateTheCurrentAddress(res_dara.data)
-      .then((res) => {
-        console.log('locateTheCurrentAddress', res)
-        data.address = res
-        settingAddress()
-      })
-      .catch((error) => {
-        console.log('获取地址失败!', error)
-        getList()
-      })
-  } else {
-    //设置默认角色
-    uni.setStorageSync('userType', 1)
-    getList()
+    .then((res) => {
+      console.log('locateTheCurrentAddress', res)
+      data.address = res
+      settingAddress()
+    })
+    .catch((error) => {
+      console.log('获取地址失败!', error)
+      getList()
+    })
+  }else{
+      //设置默认角色
+      uni.setStorageSync('userType', 1);
+      getList();
   }
 })
 

BIN
static/images/tabbar/chat.png


BIN
static/images/tabbar/class.png


BIN
static/images/tabbar/class_.png


BIN
static/images/tabbar/home.png


BIN
static/images/tabbar/home_.png


BIN
static/images/tabbar/mine.png


BIN
static/images/tabbar/mine_.png


BIN
static/images/tabbar/work.png


BIN
static/images/tabbar/work_.png


+ 4 - 1
utils/adress.js

@@ -10,6 +10,7 @@ import QQMapWX from './qqmap-wx-jssdk.js'
  * 腾讯位置服务地图选点
  */
 const chooseLocationInit = (data,addressData) => {
+	console.log("TCL: chooseLocationInit -> addressData", addressData)
   // const key = mapKey; //使用在腾讯位置服务申请的key
   // const referer = appName; //调用插件的app的名称
   // wx.navigateTo({
@@ -21,9 +22,11 @@ const chooseLocationInit = (data,addressData) => {
       ...data,
       success: function(res){
         console.log('111',res);
-        if(res.address.name){
+        if(res.address){
           const result = splitAddress(res.address);
+					console.log("TCL: chooseLocationInit -> result", result)
           const handlecityData = getCityCode([result.province,result.city,result.district].join(' '),addressData)
+					console.log("TCL: chooseLocationInit -> handlecityData", handlecityData,{...res,cityCode:handlecityData})
           resolve({...res,cityCode:handlecityData})
         }else{
           resolve(data)