Browse Source

【模版目录】更新移动端源码

吴昊天 3 years atrás
parent
commit
5c9854b6df

+ 34 - 22
template/uni-app/api/api.js

@@ -11,12 +11,23 @@
 import request from "@/utils/request.js";
 /**
  * 公共接口 ,优惠券接口 , 行业此讯 , 手机号码注册
- * 
+ *
  */
+export function getAjcaptcha(data) {
+	return request.get("ajcaptcha", data, {
+		noAuth: true
+	});
+}
+
+export function ajcaptchaCheck(data) {
+	return request.post("ajcheck", data, {
+		noAuth: true
+	});
+}
 
 /**
  * 获取主页数据 无需授权
- * 
+ *
  */
 export function getIndexData() {
 	return request.get("v2/index", {}, {
@@ -25,7 +36,7 @@ export function getIndexData() {
 }
 /**
  * 获取服务器类型
- * 
+ *
  */
 export function getServerType() {
 	return request.get("v2/site_serve", {}, {
@@ -35,7 +46,7 @@ export function getServerType() {
 
 /**
  * 获取登录授权login
- * 
+ *
  */
 export function getLogo() {
 	return request.get('wechat/get_logo', {}, {
@@ -46,7 +57,7 @@ export function getLogo() {
 
 /**
  * 保存form_id
- * @param string formId 
+ * @param string formId
  */
 export function setFormId(formId) {
 	return request.post("wechat/set_form_id", {
@@ -57,7 +68,7 @@ export function setFormId(formId) {
 /**
  * 领取优惠卷
  * @param int couponId
- * 
+ *
  */
 export function setCouponReceive(couponId) {
 	return request.post('coupon/receive', {
@@ -93,7 +104,7 @@ export function getUserCoupons(types, data) {
 
 /**
  * 首页新人优惠券
- * 
+ *
  */
 export function getNewCoupon() {
 	return request.get('v2/new_coupon')
@@ -101,7 +112,7 @@ export function getNewCoupon() {
 
 /**
  * 文章分类列表
- * 
+ *
  */
 export function getArticleCategoryList() {
 	return request.get('article/category/list', {}, {
@@ -112,7 +123,7 @@ export function getArticleCategoryList() {
 /**
  * 文章列表
  * @param int cid
- * 
+ *
  */
 export function getArticleList(cid, data) {
 	return request.get('article/list/' + cid, data, {
@@ -122,7 +133,7 @@ export function getArticleList(cid, data) {
 
 /**
  * 文章 热门列表
- * 
+ *
  */
 export function getArticleHotList() {
 	return request.get('article/hot/list', {}, {
@@ -132,7 +143,7 @@ export function getArticleHotList() {
 
 /**
  * 文章 轮播列表
- * 
+ *
  */
 export function getArticleBannerList() {
 	return request.get('article/banner/list', {}, {
@@ -142,8 +153,8 @@ export function getArticleBannerList() {
 
 /**
  * 文章详情
- * @param int id 
- * 
+ * @param int id
+ *
  */
 export function getArticleDetails(id) {
 	return request.get('article/details/' + id, {}, {
@@ -175,12 +186,13 @@ export function verifyCode() {
  * 验证码发送
  * @param object phone
  */
-export function registerVerify(phone, reset, key, code) {
+export function registerVerify(phone, reset, key, captchaType, captchaVerification) {
 	return request.post('register/verify', {
 		phone: phone,
 		type: reset === undefined ? 'reset' : reset,
 		key: key,
-		code: code
+		captchaType: captchaType,
+		captchaVerification: captchaVerification
 	}, {
 		noAuth: true
 	})
@@ -189,7 +201,7 @@ export function registerVerify(phone, reset, key, code) {
 /**
  * 手机号注册
  * @param object data
- * 
+ *
  */
 export function phoneRegister(data) {
 	return request.post('register', data, {
@@ -200,7 +212,7 @@ export function phoneRegister(data) {
 /**
  * 手机号修改密码
  * @param object data
- * 
+ *
  */
 export function phoneRegisterReset(data) {
 	return request.post('register/reset', data, {
@@ -211,7 +223,7 @@ export function phoneRegisterReset(data) {
 /**
  * 手机号+密码登录
  * @param object data
- * 
+ *
  */
 export function phoneLogin(data) {
 	return request.post('login', data, {
@@ -244,7 +256,7 @@ export function switchH5Login() {
 
 /**
  * 绑定手机号
- * 
+ *
  */
 export function bindingPhone(data) {
 	return request.post('binding', data, {
@@ -256,7 +268,7 @@ export function bindingPhone(data) {
 
 /**
  * 绑定手机号
- * 
+ *
  */
 export function bindingUserPhone(data) {
 	return request.post('user/binding', data);
@@ -264,7 +276,7 @@ export function bindingUserPhone(data) {
 
 /**
  * 退出登錄
- * 
+ *
  */
 export function logout() {
 	return request.get('logout');
@@ -438,4 +450,4 @@ export function getCrmebCopyRight() {
 	return request.get('copyright', {}, {
 		noAuth: true
 	})
-}
+}

+ 1 - 1
template/uni-app/manifest.json

@@ -167,7 +167,7 @@
     "quickapp" : {},
     /* 小程序特有相关 */
     "mp-weixin" : {
-        "appid" : "wx3b82801238ca1b57",
+        "appid" : "wx1234567890",
         "setting" : {
             "urlCheck" : false,
             "minified" : true,

+ 13 - 15
template/uni-app/pages/annex/vip_paid/index.vue

@@ -429,23 +429,21 @@
 					// #endif
 				};
 				// #ifdef MP
-				openPaySubscribe().then(() => {
-					memberCardCreate(query).then(res => {
-						if (parseFloat(this.svip.pre_price) > 0) {
-							this.callPay(res);
-						} else {
-							this.memberCard();
-							this.groomList();
-							uni.hideLoading();
-							uni.showToast({
-								title: this.$t(`成功开启0元试用`),
-							});
-						}
-					}).catch(err => {
+				memberCardCreate(query).then(res => {
+					if (parseFloat(this.svip.pre_price) > 0) {
+						this.callPay(res);
+					} else {
+						this.memberCard();
+						this.groomList();
+						uni.hideLoading();
 						uni.showToast({
-							title: err,
-							icon: 'none'
+							title: this.$t(`成功开启0元试用`),
 						});
+					}
+				}).catch(err => {
+					uni.showToast({
+						title: err,
+						icon: 'none'
 					});
 				});
 				// #endif

+ 3 - 6
template/uni-app/pages/index/diy/index.vue

@@ -680,12 +680,9 @@
 
 			// #ifdef MP
 			getTempIds() {
-				let messageTmplIds = wx.getStorageSync(SUBSCRIBE_MESSAGE);
-				if (!messageTmplIds) {
-					getTempIds().then(res => {
-						if (res.data) wx.setStorageSync(SUBSCRIBE_MESSAGE, JSON.stringify(res.data));
-					});
-				}
+				getTempIds().then(res => {
+					if (res.data) wx.setStorageSync(SUBSCRIBE_MESSAGE, JSON.stringify(res.data));
+				});
 			},
 			// #endif
 			// 对象转数组

+ 5 - 11
template/uni-app/pages/index/visualization/index.vue

@@ -472,19 +472,13 @@
 					this.getNewCoupon();
 				}
 			},
-			// 授权关闭
-			// authColse: function(e) {
-			// 	this.isShowAuth = e;
-			// },
 			// #ifdef MP
 			getTempIds() {
-				let messageTmplIds = wx.getStorageSync(SUBSCRIBE_MESSAGE);
-				if (!messageTmplIds) {
-					getTempIds().then((res) => {
-						if (res.data)
-							wx.setStorageSync(SUBSCRIBE_MESSAGE, JSON.stringify(res.data));
-					});
-				}
+				getTempIds().then((res) => {
+					if (res.data){
+						wx.setStorageSync(SUBSCRIBE_MESSAGE, JSON.stringify(res.data));
+					}
+				});
 			},
 			// #endif
 			goICP() {

+ 31 - 14
template/uni-app/pages/users/components/login_mobile/index.vue

@@ -11,6 +11,10 @@
 			</view>
 			<view class="sub_btn" @click="loginBtn">{{$t(`立即登录`)}}</view>
 		</view>
+
+		<Verify @success="success" :captchaType="'blockPuzzle'" :imgSize="{ width: '330px', height: '155px' }"
+			ref="verify"></Verify>
+
 	</view>
 </template>
 
@@ -18,6 +22,7 @@
 	const app = getApp();
 	import sendVerifyCode from "@/mixins/SendVerifyCode";
 	import Routine from '@/libs/routine';
+	import Verify from './../verify/verify.vue';
 	import {
 		loginMobile,
 		registerVerify,
@@ -31,6 +36,9 @@
 	} from '@/api/api.js'
 	export default {
 		name: 'login_mobile',
+		components: {
+			Verify
+		},
 		props: {
 			isUp: {
 				type: Boolean,
@@ -53,8 +61,29 @@
 			this.getCode();
 		},
 		methods: {
+			success(data) {
+				let that = this;
+				this.$refs.verify.hide()
+				getCodeApi().then(res => {
+					registerVerify({
+						phone: that.account,
+						key: res.data.key,
+						captchaType: 'blockPuzzle',
+						captchaVerification: data.captchaVerification
+					}).then(res => {
+						that.$util.Tips({
+							title: res.msg
+						});
+						that.sendCode();
+					}).catch(err => {
+						return that.$util.Tips({
+							title: err
+						})
+					})
+				})
+			},
 			// 获取验证码
-			async code() {
+			code() {
 				let that = this;
 				if (!that.account) return that.$util.Tips({
 					title: that.$t(`请填写手机号码`)
@@ -62,19 +91,7 @@
 				if (!/^1(3|4|5|7|8|9|6)\d{9}$/i.test(that.account)) return that.$util.Tips({
 					title: that.$t(`请输入正确的手机号码`)
 				});
-				await registerVerify({
-					phone: that.account,
-					key: that.keyCode,
-				}).then(res => {
-					that.$util.Tips({
-						title: res.msg
-					});
-					that.sendCode();
-				}).catch(err => {
-					return that.$util.Tips({
-						title: err
-					})
-				})
+				this.$refs.verify.show();
 			},
 			// 获取验证码api
 			getCode() {

+ 11 - 0
template/uni-app/pages/users/components/verify/utils/ase.js

@@ -0,0 +1,11 @@
+import CryptoJS from './crypto-js.js'
+/**
+ * @word 要加密的内容
+ * @keyWord String  服务器随机返回的关键字
+ *  */
+export function aesEncrypt(word,keyWord="XwKsGlMcdPMEhR1B"){
+  var key = CryptoJS.enc.Utf8.parse(keyWord);
+  var srcs = CryptoJS.enc.Utf8.parse(word);
+  var encrypted = CryptoJS.AES.encrypt(srcs, key, {mode:CryptoJS.mode.ECB,padding: CryptoJS.pad.Pkcs7});
+  return encrypted.toString();
+}

File diff suppressed because it is too large
+ 6191 - 0
template/uni-app/pages/users/components/verify/utils/crypto-js.js


File diff suppressed because it is too large
+ 487 - 0
template/uni-app/pages/users/components/verify/verify.vue


File diff suppressed because it is too large
+ 542 - 0
template/uni-app/pages/users/components/verify/verifyPoint/verifyPoint.vue


File diff suppressed because it is too large
+ 646 - 0
template/uni-app/pages/users/components/verify/verifySlider/verifySlider.vue


+ 33 - 16
template/uni-app/pages/users/login/index.vue

@@ -34,19 +34,20 @@
 				<view class="item">
 					<view class="acea-row row-middle">
 						<image src="../static/code_2.png" style="width: 28rpx; height: 32rpx;"></image>
-						<input type="text" :placeholder="$t(`填写验证码`)" maxlength="6" class="codeIput" v-model="captcha" />
+						<input type="text" :placeholder="$t(`填写验证码`)" maxlength="6" class="codeIput"
+							v-model="captcha" />
 						<button class="code" :disabled="disabled" :class="disabled === true ? 'on' : ''" @click="code">
 							{{ text }}
 						</button>
 					</view>
 				</view>
-				<view class="item" v-if="isShowCode">
+			<!-- 	<view class="item" v-if="isShowCode">
 					<view class="acea-row row-middle">
 						<image src="../static/code_2.png" style="width: 28rpx; height: 32rpx;"></image>
 						<input type="text" :placeholder="$t(`填写验证码`)" class="codeIput" v-model="codeVal" />
 						<view class="code" @click="again"><img :src="codeUrl" /></view>
 					</view>
-				</view>
+				</view> -->
 			</view>
 			<view class="logon" @click="loginMobile" v-if="current !== 0">{{$t(`登录`)}}</view>
 			<view class="logon" @click="submit" v-if="current === 0">{{$t(`登录`)}}</view>
@@ -89,6 +90,10 @@
 			</view>
 		</view>
 		<view class="bottom"></view>
+
+		<Verify @success="success" :captchaType="'blockPuzzle'" :imgSize="{ width: '330px', height: '155px' }"
+			ref="verify"></Verify>
+
 	</view>
 </template>
 <script>
@@ -122,14 +127,18 @@
 	// #endif
 	const BACK_URL = "login_back_url";
 	import colors from '@/mixins/color.js';
+	import Verify from '@/pages/users/components/verify/verify.vue';
 	export default {
 		name: "Login",
+		components: {
+			Verify
+		},
 		mixins: [sendVerifyCode, colors],
 		data: function() {
 			return {
 				inAnimation: false,
 				protocol: false,
-				navList: [this.$t(`快速登录`),this.$t(`账号登录`)],
+				navList: [this.$t(`快速登录`), this.$t(`账号登录`)],
 				current: 1,
 				account: "",
 				password: "",
@@ -380,6 +389,19 @@
 					this.keyCode +
 					Date.parse(new Date());
 			},
+			success(data) {
+				this.$refs.verify.hide()
+				getCodeApi()
+					.then(res => {
+						this.keyCode = res.data.key;
+						this.getCode(data);
+					})
+					.catch(res => {
+						this.$util.Tips({
+							title: res
+						});
+					});
+			},
 			code() {
 				let that = this
 				if (!that.protocol) {
@@ -388,16 +410,7 @@
 						title: '请先阅读并同意协议'
 					});
 				}
-				getCodeApi()
-					.then(res => {
-						that.keyCode = res.data.key;
-						that.getCode();
-					})
-					.catch(res => {
-						that.$util.Tips({
-							title: res
-						});
-					});
+				this.$refs.verify.show()
 			},
 			async getLogoImage() {
 				let that = this;
@@ -514,7 +527,7 @@
 						});
 					});
 			},
-			async getCode() {
+			async getCode(data) {
 				let that = this;
 				if (!that.protocol) {
 					this.inAnimation = true
@@ -534,7 +547,8 @@
 						phone: that.account,
 						type: that.type,
 						key: that.keyCode,
-						code: that.codeVal
+						captchaType: 'blockPuzzle',
+						captchaVerification: data.captchaVerification
 					})
 					.then(res => {
 						that.$util.Tips({
@@ -779,6 +793,7 @@
 			}
 		}
 	}
+
 	.protocol {
 		margin-top: 40rpx;
 		color: #999999;
@@ -786,9 +801,11 @@
 		text-align: center;
 		bottom: 20rpx;
 	}
+
 	.trembling {
 		animation: shake 0.6s;
 	}
+
 	.main-color {
 		color: var(--view-theme);
 	}

+ 28 - 18
template/uni-app/pages/users/user_phone/index.vue

@@ -16,14 +16,16 @@
 				<button form-type="submit" class="confirmBnt bg-color">{{$t(`确认绑定`)}}</button>
 			</view>
 		</form>
-		<!-- #ifdef MP -->
-		<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
-		<!-- #endif -->
+
+		<Verify @success="success" :captchaType="'blockPuzzle'"
+			:imgSize="{ width: '330px', height: '155px' }" ref="verify"></Verify>
+
 	</view>
 </template>
 
 <script>
 	import sendVerifyCode from "@/mixins/SendVerifyCode";
+	import Verify from '@/pages/users/components/verify/verify.vue';
 	import {
 		registerVerify,
 		bindingUserPhone,
@@ -44,8 +46,9 @@
 		mixins: [sendVerifyCode,colors],
 		components: {
 			// #ifdef MP
-			authorize
+			authorize,
 			// #endif
+			Verify
 		},
 		data() {
 			return {
@@ -157,11 +160,28 @@
 							title: error,
 						});
 					})
-				}	
+				}
+			},
+			success(data){
+				this.$refs.verify.hide()
+				let that = this;
+				verifyCode().then(res=>{
+					registerVerify(that.phone, 'reset', res.data.key, 'blockPuzzle',data.captchaVerification).then(res => {
+						that.$util.Tips({
+							title: res.msg
+						});
+						that.sendCode();
+					}).catch(err => {
+						return that.$util.Tips({
+							title: err
+						});
+					});
+				});
+		
 			},
 			/**
 			 * 发送验证码
-			 * 
+			 *
 			 */
 			async code() {
 				let that = this;
@@ -171,18 +191,8 @@
 				if (!(/^1(3|4|5|7|8|9|6)\d{9}$/i.test(that.phone))) return that.$util.Tips({
 					title: that.$t(`请输入正确的手机号码`)
 				});
-				await verifyCode().then(res => {
-					registerVerify(that.phone, 'reset', res.data.key, that.captcha).then(res => {
-						that.$util.Tips({
-							title: res.msg
-						});
-						that.sendCode();
-					}).catch(err => {
-						return that.$util.Tips({
-							title: err
-						});
-					});
-				})
+				this.$refs.verify.show();
+				return ;
 			}
 		}
 	}

+ 2 - 4
template/uni-app/utils/SubscribeMessage.js

@@ -40,8 +40,7 @@ export function openOrderSubscribe() {
 	let tmplIds = auth();
 	return subscribe([
 		tmplIds.order_take,
-		tmplIds.integral_accout,
-		tmplIds.order_brokerage
+		tmplIds.integral_accout
 	]);
 }
 
@@ -62,8 +61,7 @@ export function openExtrctSubscribe() {
 export function openPinkSubscribe() {
 	let tmplIds = auth();
 	return subscribe([
-		tmplIds.open_pink_success,
-		tmplIds.can_pink_success
+		tmplIds.order_user_groups_success
 	]);
 }