Просмотр исходного кода

首页商品列表接口对接

ltx529596 4 лет назад
Родитель
Сommit
7ac8ce3ce8

+ 15 - 5
src/components/rf-loading/rf-loading.vue

@@ -1,6 +1,6 @@
 <template>
   <!--加载动画-->
-  <view class="cu-load load-modal">
+  <view class="cu-load load-modal" @touchmove.stop.prevent="moveHandle">
     <!-- <image :src="src" mode="aspectFit"></image> -->
     <view class="gray-text">{{ content }}</view>
   </view>
@@ -18,14 +18,24 @@
 	export default {
 		name: 'rf-loading',
     props: {
-      src: {
-      	type: String,
-        default: $mAssetsPath.logo
-      },
+      // src: {
+      // 	type: String,
+      //   default: $mAssetsPath.logo
+      // },
       content: {
       	type: String,
         default: '加载中...'
       }
+    },
+    data() {
+      return {
+        
+      }
+    },
+    methods: {
+      moveHandle () {
+        console.log(1);
+      }
     }
 	}
 </script>

+ 4 - 2
src/config/index.config.js

@@ -2,7 +2,8 @@ const CONFIG = {
     //开发环境配置
     development: {
         assetsPath: '/static', // 静态资源路径
-        baseUrl: 'http://tyou.xiudo.cn/merch',  // 后台接口请求地址
+        // baseUrl: 'http://tyou.xiudo.cn/merch',  // 后台接口请求地址
+        baseUrl: 'http://192.168.100.175:83/merch',  // 后台接口请求地址
         hostUrl: 'http://localhost:8080',        // H5地址(前端运行地址)
         websocketUrl: '',        // websocket服务端地址
         weixinAppId: '' // 微信公众号appid
@@ -10,7 +11,8 @@ const CONFIG = {
     //生产环境配置
     production: {
         assetsPath: '/static', // 静态资源路径
-        baseUrl: 'http://tyou.xiudo.cn/merch',  // 后台接口请求地址
+        // baseUrl: 'http://tyou.xiudo.cn/merch',  // 后台接口请求地址
+        baseUrl: 'http://192.168.100.175:83/merch',  // 后台接口请求地址
         hostUrl: 'http://h5.tinyshop.rageframe.com',        // H5地址(前端运行地址)
         websocketUrl: '',        // websocket服务端地址
         weixinAppId: '' // 微信公众号appid

+ 29 - 38
src/pages.json

@@ -2,72 +2,62 @@
   "pages": [
     {
       "path": "pages/public/login",
-      "navigationBarTitleText": "登陆"
-
+      "style":{
+        "navigationBarTitleText": "登陆",
+        "navigationBarTextStyle": "black",
+        "navigationBarBackgroundColor":"#ffffff"
+      }
     },
     {
       "path": "pages/public/resetpassword",
-      "navigationBarTitleText": "找回密码",
-      "app-plus": {
-        "bounce": "none",
-        "titleNView": false,
-        "pullToRefresh": {
-          "support": true,
-          "color": "#fa436a",
-          "style": "default"
-        }
+      "style":{
+        "navigationBarTitleText": "找回密码"
       }
     },
     {
       "path":"pages/index/setting/setting",
-      "navigationBarTitleText": "设置"
+      "style":{
+        "navigationBarTitleText": "设置"
+      }
     },
     {
       "path":"pages/index/setting/changepassword",
-      "navigationBarTitleText": "修改密码"
+      "style":{
+        "navigationBarTitleText": "修改密码"
+      }
     },
     {
       "path":"pages/index/setting/cellme",
-      "navigationBarTitleText": "联系我们"
+      "style":{
+        "navigationBarTitleText": "联系我们"
+      }
     },
     {
       "path":"pages/index/setting/notice",
-      "navigationBarTitleText": "公告管理"
+      "style":{
+        "navigationBarTitleText": "公告管理"
+      }
     },
     {
       "path": "pages/public/confirmpassword",
-      "navigationBarTitleText": "找回密码",
-      "app-plus": {
-        "bounce": "none",
-        "titleNView": false,
-        "pullToRefresh": {
-          "support": true,
-          "color": "#fa436a",
-          "style": "default"
-        }
+      "style":{
+        "navigationBarTitleText": "找回密码"
       }
     },
     {
       "path": "pages/index/index",
       "style": {
-        "enablePullDownRefresh": true,
         "navigationBarTitleText": "店铺首页",
-        "onReachBottomDistance": 50,
-        "app-plus": {
-          "bounce": "none",
-          "titleNView": false,
-          "pullToRefresh": {
-            "support": true,
-            "color": "#fa436a",
-            "style": "default"
-          }
-        }
+        "navigationBarTextStyle": "black",
+        "navigationBarBackgroundColor":"#ffcd00"
       }
     },
     {
       "path":"pages/order/order",
       "style":{
-        "navigationBarTitleText": "订单管理"
+        "navigationBarTitleText": "订单管理",
+        "navigationBarTextStyle": "black",
+        "navigationBarBackgroundColor":"#ffffff"
       }
     },
 		{
@@ -85,7 +75,9 @@
     {
       "path": "pages/shop/shop",
       "style": {
-        "navigationBarTitleText": "商品管理"
+        "navigationBarTitleText": "商品管理",
+        "navigationBarTextStyle": "black",
+        "navigationBarBackgroundColor":"#ffffff"
       }
     },
 		{
@@ -100,7 +92,6 @@
 		"selectedColor": "#7d66f3",
 		"borderStyle": "black",
     "backgroundColor": "#ffffff",
-    
     "list": [{
 			"pagePath": "pages/index/index",
 			"text": "店铺首页",

+ 39 - 12
src/pages/index/index.vue

@@ -7,8 +7,8 @@
 						<view class="uni-list">
 							<view class="uni-list-cell">
 								<view class="uni-list-cell-db">
-									<picker @change="bindPickerChange" :value="index" :range="array">
-										<view class="uni-input">{{array[index]}}</view>
+									<picker @change="bindPickerChange" :value="index" :range="shopArray" range-key="name">
+										<view class="uni-input">{{ shopArray[index].name }}</view>
 									</picker>
 									<image src="../../static/images/downicon.png" mode="" class="icon"></image>
 								</view>
@@ -36,7 +36,7 @@
 					</view>
 				</view>
 			</view>
-			<view class="" style="height: 284upx;background:red;"></view>
+			<view class="" style="height: 284upx;"></view>
      
       <!-- 输入框 -->
       <view class="input-code">
@@ -202,12 +202,14 @@
 				<view class="" style="height: 40upx;"></view>
 			</view>
 		</view>
-		<!--页面加载动画-->
-		<!-- <rf-loading v-if="loading"></rf-loading> -->
+
+		<rf-loading v-if="loading"></rf-loading>
 	</view>
 </template>
 <script>
 import uCharts from '../../js_sdk/u-charts/u-charts/u-charts';
+import moment from '@/common/moment';
+
 let _self;
 let canvaLineA = null;
 let canvaPie = null;
@@ -215,12 +217,14 @@ export default {
   name: 'Header',
   data() {
     return {
-      array: ['中国', '美国', '巴西', '日本'],
+      loading: false,
+      shopArray: ['仙女山'],
       index: 0,
       cWidth: '',
       cHeight: '',
       pixelRatio: 1, // 像素比
       ordernum: null, // 订单号
+      today: moment().format('YYYY-MM-DD'),
 
       // 饼图数据
       bWidth: '',
@@ -242,18 +246,42 @@ export default {
     this.bWidth = uni.upx2px(690);
     this.bHeight = uni.upx2px(300);
     this.getServerData();
+
+    this.getShopList();
+    // this.getExponentData();
   },
   methods: {
-    bindPickerChange: function (e) {
-      console.log('picker发送选择改变,携带值为', e.target.value);
-      this.index = e.target.value;
+
+    // 选择商铺
+    bindPickerChange (e) {
+      console.log(e);
+      this.index = e.detail.value
     },
     // 跳转设置页
     tosetting() {
       this.$mRouter.push({ route: '/pages/index/setting/setting' });
     },
-    getList() {
-      console.log(1);
+
+    // 获取店铺列表
+    async getShopList () {
+      await this.$http.get('/homePage/getShopByMerId',{}).then( async (res)=>{
+        if (res.data && res.code === 200) {
+          let arry = []
+          console.log(res);
+          this.shopArray = res.data
+        }
+      })
+    },
+
+    // 关键指数
+    async getExponentData () {
+      await this.$http.get("homePage/gjzs",{
+        date: this.today,
+        shopId: 1
+      }).then( async (res) =>{
+        console.log('--------');
+        console.log(res);
+      })
     },
 
     seting() {
@@ -284,7 +312,6 @@ export default {
         url: 'https://www.ucharts.cn/data.json',
         data: {},
         success: function (res) {
-          console.log(res);
           let LineA = {
             categories: [],
             series: [],

+ 1 - 0
src/pages/public/login.vue

@@ -176,6 +176,7 @@ export default {
       await this.$http
         .get('captchaImage', {})
         .then(async (r) => {
+          console.log(r);
           this.codeImage = 'data:image/gif;base64,' + r.data.img;
           this.loginParams.uuid = r.data.uuid;
         })

+ 10 - 5
src/static/css/colorui/main.css

@@ -1056,6 +1056,7 @@ button.cuIcon.lg {
 	display: none;
 }
 
+/* loading */
 .cu-load.load-modal {
 	position: fixed;
 	top: 0;
@@ -1063,8 +1064,9 @@ button.cuIcon.lg {
 	bottom: 140upx;
 	left: 0;
 	margin: auto;
-	width: 260upx;
-	height: 260upx;
+	width: 160upx;
+	height: 160upx;
+	/* background-color: rgba(0, 0, 0, 0.5); */
 	background-color: #ffffff;
 	border-radius: 10upx;
 	box-shadow: 0 0 0upx 2000upx rgba(0, 0, 0, 0.5);
@@ -1076,6 +1078,9 @@ button.cuIcon.lg {
 	z-index: 9999;
 	line-height: 2.4em;
 }
+.cu-load.load-modal .gray-text {
+	color: #fa436a;
+}
 
 .cu-load.load-modal [class*="cuIcon-"] {
 	font-size: 60upx;
@@ -1090,10 +1095,10 @@ button.cuIcon.lg {
 .cu-load.load-modal::after {
 	content: "";
 	position: absolute;
-	background-color: #ffffff;
+	/* background-color: #ffffff; */
 	border-radius: 50%;
-	width: 200upx;
-	height: 200upx;
+	width: 110upx;
+	height: 110upx;
 	font-size: 10px;
 	border-top: 6upx solid rgba(0, 0, 0, 0.05);
 	border-right: 6upx solid rgba(0, 0, 0, 0.05);