WIN-20230912WHV\Administrator 2 yıl önce
ebeveyn
işleme
521f638247
10 değiştirilmiş dosya ile 41 ekleme ve 303 silme
  1. 0 6
      api/goods.js
  2. 6 0
      api/weChat.js
  3. 1 1
      index.html
  4. 2 2
      manifest.json
  5. 0 6
      pages.json
  6. 6 112
      pages/index/index.vue
  7. 0 156
      pages/text/index.vue
  8. 6 20
      service/router.js
  9. 20 0
      service/tools.js
  10. 0 0
      static/js/jweixin-1.2.0.js

+ 0 - 6
api/goods.js

@@ -1,6 +0,0 @@
-import { request } from '../service/ajax.js'
-// 商品模块路由
-const goodsUrl = '/api/goods/'
-// 猜你喜欢
-export const likeGoods = (data) => request(goodsUrl + 'like_goods', 'post', { ...data })
-

+ 6 - 0
api/weChat.js

@@ -0,0 +1,6 @@
+import { request } from '@/service/ajax'
+// 商品模块路由
+const url = '/api/weChat/'
+// 猜你喜欢
+export const getWxJsSign = (data) => request(url + 'js-config', 'post', { ...data })
+

+ 1 - 1
index.html

@@ -19,4 +19,4 @@
   <script type="module" src="/main.js"></script>
 </body>
 
-</html>
+</html>

+ 2 - 2
manifest.json

@@ -1,6 +1,6 @@
 {
-    "name" : "wx-wap",
-    "appid" : "__UNI__9075D31",
+    "name" : "大连中山万汇",
+    "appid" : "__UNI__E870E93",
     "description" : "",
     "versionName" : "1.0.13",
     "versionCode" : 101,

+ 0 - 6
pages.json

@@ -11,12 +11,6 @@
 			"style": {
 				"navigationBarTitleText": "登陆"
 			}
-		},
-		{
-			"path": "pages/text/index",
-			"style": {
-				"navigationBarTitleText": "列表演示"
-			}
 		}
 	],
 

+ 6 - 112
pages/index/index.vue

@@ -1,106 +1,23 @@
 <template>
 	<view class="box-data">
-		<Nav title="首页"></Nav>
-<!--		<view class="border-item"></view>-->
-<!--		<enInput v-model="text" label="姓名姓名"></enInput>-->
-<!--		<enSend v-model="phone" ref="enSendObj" @getCode="getCode"></enSend>-->
-<!--		<enCheckbox v-model="type" label="爱好爱好" :checkboxData="checkboxData"></enCheckbox>-->
-<!--		<enRadio v-model="sex" label="性别性别" :radioData="radioData"></enRadio>-->
-<!--		<enSwitch v-model="status" label="状态试"></enSwitch>-->
-<!--		<enTextarea v-model="content" label="个人简介"></enTextarea>-->
-<!--		<enDate v-model="birthday" type="datetime" label="生日生日"></enDate>-->
-		<enHeadImg v-model="img" label="修改头像"></enHeadImg>
-		<enSelect v-model="classIds" :local-data="[]" label="班级"></enSelect>
-<!--		<enUpload v-model="imgs" ></enUpload>-->
-
-
-		<view class="" @click="toList()">进入列表演示</view>
-    <button class="box-but" style="background-color: #DD524D;color: #FFFFFF">确定</button>
+    测试环境开始
 	</view>
 
 </template>
 <script>
-	import enInput from "components/en-from/en-input/en-input"
-	import enSend from "components/en-from/en-send/en-send"
-	import enCheckbox from "components/en-from/en-checkbox/en-checkbox"
-	import enRadio from "components/en-from/en-radio/en-radio"
-	import enSwitch from "components/en-from/en-switch/en-switch"
-	import enTextarea from "components/en-from/en-textarea/en-textarea"
-	import enDate from "components/en-from/en-date/en-date"
-	import enHeadImg from "components/en-from/en-head/en-head-img"
-	import enUpload from "components/en-from/en-upload/en-upload"
-	import enSelect from "components/en-from/en-select/en-select"
+
 
 	export default {
 		components: {
-      enSelect,
-      enUpload,
-			enDate,
-		 enTextarea,
-		 enSwitch,
-			enRadio,
-			enCheckbox,
-			enInput,
-			enSend,
-			enHeadImg
+
 		},
 		data() {
 			return {
-				img:require('@/static/img/2.jpg'),
-        imgs:[require('@/static/img/2.jpg')],
-				phone: '13900139001',
-        classIds: '2-0,2-2',
-				birthday: '',
-				text: '',
-				content: '你会火星语吗?你会火星语吗?你会火星语吗?你会火星语吗?你会火星语吗?你会火星语吗?你会火星语吗?你会火星语吗?你会火星语吗?你会火星语吗?你会火星语吗?你会火星语吗?你会火星语吗?你会火星语吗?你会火星语吗?你会火星语吗?你会火星语吗?你会火星语吗?你会火星语吗?你会火星语吗?你会火星语吗?你会火星语吗?',
-				type: ['1'],
-				sex: '1',
-				status: 1,
-				// checkboxData:[{'id':'1','name':'足球'},{'id':'2','name':'篮球'},{'id':'3','name':'排球'},{'id':'4','name':'羽毛球'},{'id':'5','name':'乒乓球'},{'id':'6','name':'铅球'},{'id':'7','name':'棒球'},{'id':'8','name':'冰球'},{'id':'9','name':'网球'},{'id':'10','name':'乒乓球'}]
-				checkboxData: [{
-					'id': '1',
-					'name': '足球'
-				}, {
-					'id': '2',
-					'name': '篮球'
-				}, {
-					'id': '3',
-					'name': '排球'
-				}],
-				radioData: [{
-					'id': '1',
-					'name': '男'
-				}, {
-					'id': '2',
-					'name': '女'
-				}]
+
 			}
 		},
 		watch: {
-      'classIds': function() {
-        console.log('new--------classIds', this.classIds)
-      },
-      'imgs': function() {
-        console.log('new--------imgs', this.imgs)
-      },
-			'birthday': function() {
-				console.log('new--------birthday', this.birthday)
-			},
-			'content': function() {
-				console.log('new--------content', this.content)
-			},
-			'type': function() {
-				console.log('new--------type', this.type)
-			},
-			'phone': function() {
-				console.log('new--------' + this.phone)
-			},
-			'text': function() {
-				console.log('new--------' + this.text)
-			},
-			'status': function() {
-				console.log('new--------' + this.status)
-			}
+
 
 		},
 
@@ -108,35 +25,12 @@
 
 		},
 		methods: {
-			getCode() {
-				console.log('---------------------asdsa')
-				this.text = 'abc'
-				this.$refs.enSendObj.setCodeNum()
-			},
-			toList() {
-				uni.navigateTo({
-					url: '/pages/text/index'
-				})
-			},
+
 
 		},
 	}
 </script>
 <style lang="scss" scoped>
-	.border-item {
-		border-bottom: 2rpx solid #F0F0F0;
-	}
 
-	.box-data {
-    min-height: 100vh;
-		padding: 32rpx 32rpx 0;
-		background-color: #fff;
-    .box-but{
-      position: fixed;
-      width: 80%;
-      left: 10%;
-      bottom: 40rpx;
-    }
-	}
 
 </style>

+ 0 - 156
pages/text/index.vue

@@ -1,156 +0,0 @@
-<template>
-	<view>
-		<Nav title="列表组件演示"></Nav>
-		<pagingList ref="likeGoodsList" @getList="getGoodsList">
-      <template v-slot:listInfo="{pagingData}">
-        <view class="goods-list">
-          <view class="goods-item" v-for="item in pagingData">
-            <view class="goods-item-left">
-              <image class="goods-item-img" :src="item.cover_img" mode="aspectFill"></image>
-            </view>
-            <view class="goods-item-right">
-              <view class="goods-item-name">{{item.good_name}}</view>
-              <view class="goods-item-price goods-item-zh" v-if="item.p_type===1">
-                <view class="item-price">
-                  <enPrice :currentPrice="item.price" :originalPrice="item.original_price"></enPrice>
-                </view>
-                <view class="item-market">
-                  <text class="iconfont">&#xe61a;</text>
-                  <text>5.0评分</text>
-                  <text>2W+人付款</text>
-                </view>
-              </view>
-              <view class="goods-item-price goods-item-tp" v-else>
-                <view class="goods-item-platform">
-                  <text class="goods-item-tp"  v-if="item.p_type===2">天猫好物</text>
-                  <text class="goods-item-jd"  v-else>京东优选</text>
-                </view>
-                <view class="item-price">
-                  <enPrice :currentPrice="item.price" :originalPrice="item.original_price"></enPrice>
-                </view>
-              </view>
-
-            </view>
-          </view>
-        </view>
-      </template>
-    </pagingList>
-	</view>
-</template>
-
-<script>
-	import Black from '@/components/en-utils/en-blank/en-blank'
-	import pagingList from '@/components/en-list/en-list'
-  import enPrice from '@/components/en-utils/en-price/en-price'
-  import {likeGoods} from "@/api/goods";
-
-	export default {
-		components:{
-			Black,
-      pagingList,
-      enPrice,
-		},
-    methods:{
-      getGoodsList(page){
-          likeGoods({'page':page}).then((res)=>{
-            if(res.code===1){
-              this.$refs.likeGoodsList.setList(res.data.list,res.data.total)
-            }
-          })
-      }
-    }
-	}
-</script>
-
-<style scoped lang="scss">
-    @font-face {
-      font-family: 'iconfont';
-      src:  url('/components/static/icon/iconfont.ttf') format('truetype');
-    }
-    .iconfont {
-      font-family: "iconfont" !important;
-      font-style: normal;
-      -webkit-font-smoothing: antialiased;
-      -moz-osx-font-smoothing: grayscale;
-    }
-    .goods-list{
-      background-color: #F5F5F5;
-      margin: 0 24rpx;
-      .goods-item{
-        width: 100%;
-        height: 364rpx;
-        background-color: #FFFFFF;
-        border-radius: 20rpx;
-        margin: 20rpx 0;
-        display: flex;
-        .goods-item-left{
-          padding: 24rpx;
-          .goods-item-img{
-            width:316rpx;
-            height:316rpx;
-            border-radius: 16rpx;
-          }
-        }
-        .goods-item-right{
-          width:100%;
-          height:300rpx;
-          padding:32rpx 30rpx 32rpx 0;
-          position:relative;
-          //display: flex;
-          //align-content: space-between;
-          .goods-item-name{
-            color: #333333;
-            font-size: 30rpx;
-            font-weight: 600;
-            display: -webkit-box;
-            -webkit-line-clamp: 2;
-            -webkit-box-orient: vertical;
-            overflow: hidden;
-          }
-          .goods-item-price{
-            position:absolute;
-            bottom: 32rpx;
-            .item-price{
-
-            }
-            .item-market{
-                text{
-                  color: #999999;
-                  font-size: 24rpx;
-                  line-height: 34rpx;
-                  padding: 0 20rpx 0 0;
-                }
-              .iconfont{
-                padding: 0;
-              }
-            }
-          }
-          .goods-item-platform{
-            height: 32rpx;
-            margin-bottom: 10rpx;
-            .goods-item-tp{
-              padding: 4rpx 8rpx;
-              color: #975BFE;
-              width: 90rpx;
-              height: 30rpx;
-              font-size: 24rpx;
-              line-height: 28rpx;
-              border: 2rpx solid #985DFF;
-              border-radius: 4rpx;
-            }
-            .goods-item-jd{
-              padding: 4rpx 8rpx;
-              border-radius: 6rpx;
-              color: #FFFFFF;
-              font-size: 24rpx;
-              line-height: 28rpx;
-              background: linear-gradient(90deg, #FD3229 0%, #FC7A28 100%);
-            }
-          }
-          .goods-item-zh{
-
-          }
-        }
-      }
-    }
-</style>

+ 6 - 20
service/router.js

@@ -15,30 +15,16 @@ const router = createRouter({
     routes: [...ROUTES]
 });
 //全局路由前置守卫
-const whiteList = ['/pages/text/index','/pages/login/forget','/pages/login/register','/pages-user/pages/explain','/pages/index/down']
+const whiteList = ['/pages/login/index']
 
 router.beforeEach((to, from, next) => {
     const userToken = uni.getStorageSync('token')
-    // const userMid = uni.getStorageSync('m_id')
-    console.log('userToken:'+userToken)
-    // console.log('m_id:'+userMid)
-    console.log('path:'+to.fullPath)
-    // #ifdef APP-PLUS
-    if(!userToken  && whiteList.indexOf(to.path)<0){
-        if(to.fullPath!=='/pages/login/index'){
-            next('/pages/login/index');
-        }
-    }else if(userToken && to.fullPath==='/pages/login/index'){
-        next('/pages/index/index');
-    }
-    // #endif
+
+
     // #ifdef H5
-        if(process.uniEnv.version==='prod'){
-            let wapUrl=['/pages/login/register','/pages-user/pages/explain','/pages/index/down']
-            if(wapUrl.indexOf(to.path)<0){
-                next('/pages/index/down');
-            }
-        }
+    if(whiteList.indexOf(to.path)<0 && !userToken){
+        tools.wxLogin()
+    }
     // #endif
     next();
 

+ 20 - 0
service/tools.js

@@ -1,3 +1,5 @@
+import  wxJs from 'static/js/jweixin-1.2.0'
+
 let tools = {}
 /**
  * 大小判断
@@ -225,5 +227,23 @@ tools.setLoginData = function (data) {
 
 }
 
+tools.jsConfig=function () {
+    wxJs.config({
+        beta: true,// 必须这么写,否则wx.invoke调用形式的jsapi会有问题
+        debug: true, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
+        appId: '', // 必填,企业微信的corpID,必须是本企业的corpID,不允许跨企业使用
+        timestamp: '', // 必填,生成签名的时间戳
+        nonceStr: '', // 必填,生成签名的随机串
+        signature: '',// 必填,签名,见 附录-JS-SDK使用权限签名算法
+        jsApiList: [] // 必填,需要使用的JS接口列表,凡是要调用的接口都需要传进来
+    });
+}
+
+tools.wxLogin = function () {
+    // 微信浏览器
+    let url = encodeURIComponent(window.location.href);
+    window.location.href = `https://test-api.wealfavor.cn/api/weChat/wx?redirect_url=${Base64.encode(url)}`
+}
+
 
 export default tools

Dosya farkı çok büyük olduğundan ihmal edildi
+ 0 - 0
static/js/jweixin-1.2.0.js


Bu fark içinde çok fazla dosya değişikliği olduğu için bazı dosyalar gösterilmiyor