lilei 7 miesięcy temu
rodzic
commit
e8495d0649
6 zmienionych plików z 44 dodań i 17 usunięć
  1. 10 5
      .hbuilderx/launch.json
  2. 2 2
      App.vue
  3. 1 1
      manifest.json
  4. 4 2
      pages/index/index.vue
  5. 25 4
      pages/login/login.vue
  6. 2 3
      pages/login/phoneLogin.vue

+ 10 - 5
.hbuilderx/launch.json

@@ -2,10 +2,15 @@
   // launchtype项可配置值为local或remote, local代表前端连本地云函数,remote代表前端连云端云函数
     "version": "0.0",
     "configurations": [{
-            "type": "uniCloud",
-            "default": {
-                "launchtype": "remote"
-            }
-        }
+     	"default" : 
+     	{
+     		"launchtype" : "remote"
+     	},
+     	"mp-weixin" : 
+     	{
+     		"launchtype" : "remote"
+     	},
+     	"type" : "uniCloud"
+     }
     ]
 }

+ 2 - 2
App.vue

@@ -1,6 +1,6 @@
 <script>
-	const uat_domain = 'https://lese.test.zyucgj.com' // 预发布
-	// const uat_domain = 'http://192.168.16.105:8302' // 本地
+	// const uat_domain = 'https://lese.test.zyucgj.com' // 预发布
+	const uat_domain = 'http://192.168.2.103:8302' // 本地
 	const pro_domain = 'https://lese.zyucgj.cn' // 生产
 	const uat_URL = uat_domain+'/gc-shop/' // 预发布
 	const pro_URL = pro_domain+'/gc-shop/'  // 生产

+ 1 - 1
manifest.json

@@ -57,7 +57,7 @@
     "quickapp" : {},
     /* 小程序特有相关 */
     "mp-weixin" : {
-        "appid" : "wx623b3d89df212494",
+        "appid" : "wxf217a17daf0876e3",
         "setting" : {
             "urlCheck" : false,
             "es6" : true,

+ 4 - 2
pages/index/index.vue

@@ -109,8 +109,6 @@
 		onLoad() {
 			// 检查更新
 			this.checkUpdate()
-			// 查询购物车列表
-			this.getCartList()
 			// 刷新购物车列表
 			uni.$on("getCartList",item =>{
 				this.getCartList()
@@ -159,6 +157,10 @@
 						url:"/pages/login/login"
 					})
 				}
+				if(this.hasLogin){
+					// 查询购物车列表
+					this.getCartList()
+				}
 			})
 		},
 		methods: {

+ 25 - 4
pages/login/login.vue

@@ -6,12 +6,20 @@
 					<u-image src="/static/logo.png" width="140" height="140" ></u-image>
 				</view>
 				<view class="login-btns">
-					<u-button shape="circle" :custom-style="wxButton" class="login-btn" type="success" :hair-line="false" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">
-						微信登录
+					<u-button
+					shape="circle" 
+					:custom-style="wxButton" 
+					class="login-btn" 
+					type="success" 
+					:hair-line="false" 
+					:open-type="tyYd?'getPhoneNumber':''" 
+					@click="getCheckYd"
+					@getphonenumber="getPhoneNumber">
+						手机号快捷登录
 					</u-button>
 					<u-gap height="30"></u-gap>
 					<u-button shape="circle" :custom-style="phoneButton" class="login-btn" @click="phoneLogin" type="primary">
-						手机号码登录
+						手机验证码登录
 					</u-button>
 				</view>
 			</view>
@@ -21,7 +29,10 @@
 				</u-button>
 			</view>
 		</view>
-		<view @click="toYs">登录即代表同意<text>隐私政策</text>和<text>服务条款</text></view>
+		<view class="xieyi" style="display: flex;align-items: center;padding:50upx 0;justify-content: center;font-size: 24rpx;">
+			<u-checkbox v-model="tyYd" :label-size="24">登录代表您已同意</u-checkbox>
+			<text style="margin-left: -20rpx;" @click="toYs()">隐私政策、服务条款</text>
+		</view>
 	</view>
 </template>
 
@@ -35,6 +46,7 @@
 			return {
 				path: '/pages/index/index',
 				lanuch: false,
+				tyYd: false,
 				code: '',
 				url:'', // 二维码参数
 				wxButton: {
@@ -78,6 +90,15 @@
 					url: '/pages/agreement/agreement'
 				})
 			},
+			getCheckYd(){
+				if(!this.tyYd){
+					uni.showToast({
+						title: "请阅读并同意隐私政策、服务条款",
+						icon: "none"
+					})
+					return
+				}
+			},
 			getPhoneNumber(e) {
 				let _this = this
 				uni.showLoading({

+ 2 - 3
pages/login/phoneLogin.vue

@@ -56,7 +56,6 @@
 		onLoad(opts) {
 			console.log(opts,'----参数')
 			this.encode=opts.encode
-			console.log(opts,this.encode,'----参数')
 			// 开启分享
 			uni.showShareMenu({
 				withShareTicket: true,
@@ -66,8 +65,8 @@
 				path,
 				lanuch,
 				encode
-			} = option;
-			// console.log(option,'----参数')
+			} = opts;
+			// console.log(opts,'----参数')
 			this.lanuch = (lanuch + '') === 'true';
 		},
 		onUnload() {