hmp 4 лет назад
Родитель
Сommit
872672e84a

+ 19 - 1
assets/http/api.js

@@ -11,6 +11,11 @@ const uploadFile = (p) => http.upload(uploadFileUrl, {
 	filePath: p
 })
 
+//手机验证码
+const sms={
+	send:p => http.post('/sms/sendSms'+p)
+}
+
 
 const notice = {
 	detail: p => http.get('sing_active/activenotice/detail', {
@@ -19,6 +24,10 @@ const notice = {
 	list: p => http.get('sing_active/activenotice/list', {
 		params: p
 	}),
+	//从缓存中获取
+	getDetail: p => http.get('app/active/notice/getNotice', {
+		params: p
+	}),
 }
 
 const platform = {
@@ -259,9 +268,17 @@ const activerecord = {
 	}),
 }
 
+//海报配置
+const poster={
+	detail: p => http.get('sing_active/activeposter/detail', {
+		params: p
+	})
+}
+
 
 export const api = {
 	uploadFileUrl,
+	sms,
 	uploadFile,
 	dict,
 	wxApp,
@@ -279,5 +296,6 @@ export const api = {
 	notice,
 	area,
 	census,
-	activerecord
+	activerecord,
+	poster
 }

+ 2 - 2
assets/http/config.js

@@ -1,7 +1,7 @@
 let config = {}
 
-// config.baseURL = 'http://192.168.1.168:2888'
-config.baseURL = 'https://vote.guosen-fumao.cn/api'
+config.baseURL = 'http://192.168.1.168:2888'
+// config.baseURL = 'https://vote.guosen-fumao.cn/api'
 //是否需要获取手机号
 config.isAuthPhone = true
 config.transformDomains = 'https://m.changyoyo.com'

+ 57 - 8
components/login.vue

@@ -30,7 +30,7 @@
 		<view @touchmove.stop.prevent="clear" v-show="dialogShow">
 			<view class="popup_mask" @touchmove.stop.prevent="clear"></view>
 			<view class="">
-				<view class="dt-login-wrap">
+				<view class="dt-login-wrap" >
 					<view class="title">请先登录</view>
 					<view class="content">
 						<view class="userinfo-avatar">
@@ -54,18 +54,22 @@
 		<view @touchmove.stop.prevent="clear" v-show="dialogShow">
 			<view class="popup_mask" @touchmove.stop.prevent="clear"></view>
 			<view class="">
-				<view class="dt-login-wrap">
+				<view class="dt-login-wrap" style="width: 580rpx;margin-left: -290rpx;">
 					<view class="title">请先登录</view>
-					<view class="content" style="padding: 120rpx 30rpx ;">
+					<view class="content" style="padding: 120rpx 40rpx ;">
 						<u-form :model="form" ref="uForm" label-width="140" :border-bottom="borderBottom">
 							<u-form-item label="手机号">
 								<u-input v-model="form.phone" :clearable="false" />
 							</u-form-item>
 							<u-form-item label="验证码">
-								<u-input v-model="form.code" :clearable="false" />
+								<u-input :clearable="false" placeholder="请输入验证码" v-model="form.code"
+									type="text"></u-input>
+								<button slot="right" class="u-reset-button cu-btn radius sm bg-base" style="padding: 0 15rpx;height: 42rpx;" @click="getCode">
+									{{codeTips}}
+								</button>
 							</u-form-item>
 						</u-form>
-						<view class="text-sm text-gray margin-top-10 text-left">
+						<view class="text-sm text-gray margin-top-20 text-left">
 							<text style="color: #EF9944;">* 未注册过的手机号,点击登录时我们会给您创建一个新的账号</text>
 						</view>
 					</view>
@@ -78,7 +82,7 @@
 			</view>
 		</view>
 		<!-- #endif -->
-
+		<u-verification-code seconds="60" ref="uCode" @change="codeChange"></u-verification-code>
 		<toast ref="toast"></toast>
 	</view>
 </template>
@@ -91,6 +95,12 @@
 		},
 		data() {
 			return {
+				customStyle: {
+					'backgroundColor': '#EF9944',
+					'color': '#ffffff'
+				},
+				codeTips: '',
+				
 				borderBottom: false,
 
 				notToast: false,
@@ -112,7 +122,8 @@
 				//h5登录
 				form: {
 					phone: '',
-					code: ''
+					code: '',
+					smsId:""
 				}
 			};
 		},
@@ -128,6 +139,35 @@
 			}
 		},
 		methods: {
+			codeChange(text) {
+				this.codeTips = text;
+			},
+			// 获取验证码
+			getCode() {
+				if (this.$isEmpty(this.form.phone)) {
+					this.$refs.toast.info('请输入手机号')
+					return
+				}
+				if (this.$refs.uCode.canGetCode) {
+					// 模拟向后端请求验证码
+					let params = {
+						phone: this.form.phone
+					}
+					let p = this.$u.queryParams(params)
+					this.$api.sms.send(p).then(res => {
+						if (res.data.data.success) {
+							this.form.smsId =res.data.data.id
+							this.$refs.toast.info('验证码已发送')
+							// 通知验证码组件内部开始倒计时
+						} else {
+							this.$u.toast(res.data);
+						}
+						this.$refs.uCode.start();
+					})
+				} else {
+					this.$refs.toast.info('倒计时结束后再发送')
+				}
+			},
 			async h5Login() {
 				if (this.$isEmpty(this.form.phone)) {
 					this.$u.toast("请输入手机号")
@@ -137,8 +177,17 @@
 					this.$u.toast("请输入验证码")
 					return
 				}
+				if (this.$isEmpty(this.form.smsId)) {
+					this.$u.toast("验证码已过期,请重新获取")
+					return
+				}
 				let res = await this.$api.loginUser.h5Login(this.form)
-				if (this.$isEmpty(res.data.data)) {
+				console.log(res);
+				if (!res.success) {
+					this.$u.toast(res.msg)
+					return
+				}
+				if (this.$isEmpty(res.data.data)) {	
 					this.$u.toast(res.data.msg)
 					return
 				}

+ 58 - 22
components/poster/poster.vue

@@ -1,15 +1,16 @@
 <template>
-	<view class="content" v-if="isShow" >
+	<view class="content" v-if="isShow">
 		<view style="position: relative;">
-			<image :src="img" style="height: 950rpx;width: 550rpx;"  @load="load"></image>
-			<image @click.stop="isShow=false" style="position: absolute;right: -50rpx;top: -60rpx;width: 50rpx;height: 50rpx;" src="@/static/icon/close.png" mode=""></image>
+			<image :src="img" style="height: 950rpx;width: 550rpx;" @load="load"></image>
+			<image @click.stop="isShow=false"
+				style="position: absolute;right: -50rpx;top: -60rpx;width: 50rpx;height: 50rpx;"
+				src="@/static/icon/close.png" mode=""></image>
 		</view>
 
 		<view class="btn" v-if="imgLoad">
 			<view class="save-btn" @click.stop="saveImage">保存图片</view>
 			<!-- <view class="save-btn" @click.stop="goLottery" v-if="subTitle"> 去抽奖 </view> -->
 		</view>
-
 		<canvas style="position: fixed;top: 999999999rpx;" @click.stop=""
 			:style="{ width: canvasW + 'px', height: canvasH + 'px' }" canvas-id="my-canvas"></canvas>
 	</view>
@@ -18,9 +19,9 @@
 <script>
 	export default {
 		props: {
-			headerImg: {
-				type: String,
-				default: 'https://vote.guosen-fumao.cn/obsfile/fa4631ad16f64357a4ec84c81064102d-%E5%88%86%E4%BA%AB%E6%B5%B7%E6%8A%A5.jpg'
+			activeId:{
+				type:String,
+				default:''
 			},
 			avatar: {
 				type: String,
@@ -41,6 +42,18 @@
 		},
 		data() {
 			return {
+				posterParams:{
+					//背景图
+					bgImg:"https://vote-obs.guosen-fumao.cn/ce6e19c78f1b4220b4716ea11af960f5-z70fIvNXVEQ11b0ee4e6d35913e6f22391705967fe3f.jpg",
+					//头像大小
+					avatarSize:160,
+					//头像的Y坐标
+					avatarY:500,
+					//标题的y坐标
+					titleY:80,
+					//副标题的y坐标
+					subTitleY:130
+				},
 				imgLoad: false,
 				img: '',
 				canvasW: 0,
@@ -50,18 +63,39 @@
 				qrcode: '',
 			}
 		},
+		created() {
+			this.initParams()
+		},
 		methods: {
-			saveImage(){
-				
+			initParams(){
+				let params={
+					activeId:this.activeId
+				}
+				this.$api.poster.detail(params).then(res=>{
+					if (this.$isNotEmpty(res.data.data)) {
+						this.posterParams=res.data.data
+					}
+				})
 			},
-			goLottery(){
+			goLottery() {
 				uni.navigateTo({
-					url:"/pages/webview/webview?url= "+encodeURIComponent('https://api.jijipai.cn/h5/#/pages/activity/lottery?drawId=12')
+					url: "/pages/webview/webview?url= " + encodeURIComponent(
+						'https://api.jijipai.cn/h5/#/pages/activity/lottery?drawId=12')
 				})
 			},
 			load() {
 				this.imgLoad = true
 			},
+			chkstrlen(str) {
+				var strlen = 0;
+				for (var i = 0; i < str.length; i++) {
+					if (str.charCodeAt(i) > 255) //如果是汉字,则字符串长度加2
+						strlen += 2;
+					else
+						strlen++;
+				}
+				return strlen;
+			},
 			//显示
 			showCanvas() {
 				this.isShow = true
@@ -83,37 +117,39 @@
 				//绘制圆角背景
 				this.drawRoundRect(this.ctx, 0, 0, this.canvasW, this.canvasH, 0, '#f82001')
 				//绘制标题图
-				let headerImg = await this.getImageInfo(this.headerImg)
+				let bgImg = await this.getImageInfo(this.posterParams.bgImg)
 				let hW = uni.upx2px(750);
 				let hH = uni.upx2px(1333);
-				this.drawRoundImg(this.ctx, headerImg.path, ((this.canvasW - hW) / 2), ((this.canvasW - hW) / 2), hW,
+				this.drawRoundImg(this.ctx, bgImg.path, ((this.canvasW - hW) / 2), ((this.canvasW - hW) / 2), hW,
 					hH, 0)
 				//绘制头像
-				const userInfo =  uni.getStorageSync("userInfo");
-				let avatar = await this.getImageInfo( userInfo.avatar ||this.avatar)
-				let avatarW = 290
-				let aW = uni.upx2px(avatarW);
-				this.drawRoundImg(this.ctx, avatar.path, (hW - aW) / 2, uni.upx2px(222), aW, aW, uni.upx2px(avatarW /
+				const userInfo = uni.getStorageSync("userInfo");
+				let avatar = await this.getImageInfo(userInfo.avatar || this.avatar)
+				let aW = uni.upx2px(this.posterParams.avatarSize);
+				this.drawRoundImg(this.ctx, avatar.path, (hW - aW) / 2, uni.upx2px(this.posterParams.avatarY), aW, aW, uni.upx2px(this.posterParams.avatarSize /
 					2))
 				//绘制标题
 				let titleSize = 20
+				let titleLen=this.chkstrlen(this.title) / 2
 				let titleParams = {
 					color: '#fff',
-					x: (hW / 2) - (this.title.length * titleSize / 2) - 10,
-					y: (hH / 2) + uni.upx2px(110)
+					x: (hW / 2) - ( titleLen * titleSize / 2),
+					y: (hH / 2) + uni.upx2px(this.posterParams.titleY)
 				}
 				this.ctx.font = "19px 华文楷体"
 				this.ctx.setFontSize(titleSize); //设置标题字体大小
 				this.ctx.setFillStyle('#fff'); //设置标题文本颜色
 				this.ctx.fillText(this.title, titleParams.x, titleParams.y)
 				//绘制副标题
+				let subTitleLen=this.chkstrlen(this.subTitle) / 2
 				let subTitleParams = {
 					color: '#fff',
-					y: (hH / 2) + uni.upx2px(170)
+					x:(hW / 2) - ( subTitleLen * titleSize / 2),
+					y: (hH / 2) + uni.upx2px(this.posterParams.subTitleY)
 				}
 				this.ctx.setFontSize(titleSize); //设置标题字体大小
 				this.ctx.setFillStyle('#fff'); //设置标题文本颜色
-				this.ctx.fillText(this.subTitle, titleParams.x, subTitleParams.y)
+				this.ctx.fillText(this.subTitle, subTitleParams.x, subTitleParams.y)
 				//小程序码
 				// let qrSize = uni.upx2px(200)
 				// let qrcodeImg = await this.getImageInfo(this.qrcode)

+ 10 - 35
pages.json

@@ -11,14 +11,13 @@
 			}
 		},
 		{
-		    "path" : "pages/activity/list",
-		    "style" :                                                                                    
-		    {
-		        "navigationBarTitleText": "活动列表",
-		        "enablePullDownRefresh": false,
-				"navigationStyle":"custom"
-		    }
-		    
+			"path": "pages/activity/list",
+			"style": {
+				"navigationBarTitleText": "活动列表",
+				"enablePullDownRefresh": false,
+				"navigationStyle": "custom"
+			}
+
 		},
 		{
 			"path": "pages/introduce/introduce",
@@ -106,7 +105,7 @@
 			"style": {
 				"navigationBarTitleText": "授权结果",
 				"enablePullDownRefresh": false,
-				"navigationStyle":"custom"
+				"navigationStyle": "custom"
 			}
 
 		}, {
@@ -144,7 +143,7 @@
 			"style": {
 				"navigationBarTitleText": "授权结果",
 				"enablePullDownRefresh": false,
-				"navigationStyle":"custom"
+				"navigationStyle": "custom"
 			}
 
 		}, {
@@ -170,30 +169,6 @@
 				"navigationStyle": "custom"
 			}
 
-		}, {
-			"path": "pages/endorsement/endorsement",
-			"style": {
-				"navigationBarTitleText": "我要代言",
-				"enablePullDownRefresh": false,
-				"navigationStyle": "custom"
-			}
-
-		}, {
-			"path": "pages/rule/rule",
-			"style": {
-				"navigationBarTitleText": "活动规则",
-				"enablePullDownRefresh": false,
-				"navigationStyle": "custom"
-			}
-
-		}, {
-			"path": "pages/rule/point",
-			"style": {
-				"navigationBarTitleText": "积分兑换规则",
-				"enablePullDownRefresh": false,
-				"navigationStyle": "custom"
-			}
-
 		}, {
 			"path": "pages/address/address",
 			"style": {
@@ -244,7 +219,7 @@
 			}
 
 		}
-    ],
+	],
 	"tabBar": {
 		"color": "#555555",
 		"backgroundColor": "#FFFFFF",

+ 5 - 3
pages/activity/activityDetail.vue

@@ -53,7 +53,7 @@
 
 		<vote-popup ref="votePopup" @toVote="toVote"></vote-popup>
 		<!-- 海报 -->
-		<poster ref="poster" :avatar="posetrParams.avatar" :title="posetrParams.title"
+		<poster v-if="$isNotEmpty(posetrParams.activeId)" ref="poster" :avatar="posetrParams.avatar" :activeId="posetrParams.activeId" :title="posetrParams.title"
 			:subTitle="posetrParams.subTitle"></poster>
 		<share-popup ref="sharePopup" @confirm="shareConfirm"></share-popup>
 		<timeline-popup ref="timelinePopup"></timeline-popup>
@@ -151,7 +151,8 @@
 				posetrParams: {
 					avatar: '',
 					title: '我是普法帮帮代言人',
-					subTitle: '邀请您为888号作品投票!'
+					subTitle: '邀请您为888号作品投票!',
+					activeId:''
 				},
 				activity: {},
 				customStyle: {
@@ -223,7 +224,8 @@
 				this.posetrParams = {
 					avatar: this.defaultAvatar,
 					title: title,
-					subTitle: '邀请您为' + this.activity.productNo + '号作品投票!'
+					subTitle: '邀请您为' + this.activity.productNo + '号作品投票!',
+					activeId:this.activity.activeId
 				}
 				let userId = this.vuex_userId || '000000' //游客
 				let sharePath = '/pages/activity/activityDetail?id=' + this.activity.id + '&userId=' + userId

+ 0 - 69
pages/endorsement/endorsement.vue

@@ -1,69 +0,0 @@
-<template>
-	<view class="u-content">
-		<!-- #ifdef MP-WEIXIN -->
-		<u-navbar title-color="#000000"  :is-back="true" title="我要代言"></u-navbar>
-		<!-- #endif -->
-		 <mescroll-body ref="mescrollRef" @init="mescrollInit" :down="downOption" @down="downCallback" @up="upCallback">
-			<u-parse :html="content" ></u-parse>
-		</mescroll-body>
-	</view>
-</template>
-
-<script>
-	import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
-	export default {
-		mixins: [MescrollMixin],
-		data() {
-			return {
-				downOption:{
-					use:false,
-					auto:false
-				},
-				content:'',
-				list: [] // 数据列表
-			}
-		},
-		methods: {
-			downCallback(){
-				setTimeout(()=>{
-					this.mescroll.resetUpScroll();
-				},1000)
-			},
-			upCallback(mescroll) {
-				try {
-					let params={
-						title:'我要代言',
-						activeId:this.vuex_active_setting.defaultActiveId,
-						current:mescroll.num,
-						size:mescroll.size,
-					}
-					this.$api.notice.list(params).then(res => {
-						let data = res.data.data.records
-						let total = res.data.data.total
-						mescroll.endBySize(data.length, total);
-						if (mescroll.num == 1) this.list = []; //如果是第一页需手动制空列表
-						this.list = this.list.concat(data); //追加新数据
-						this.content = decodeURIComponent(this.list[0].content)
-					}).catch(err=>{
-						console.log(err);
-					})
-				} catch (e) {
-					console.error(e);
-					this.mescroll.endErr()
-				}
-			}
-		}
-	}
-</script>
-
-<style >
-	page{
-		background-color: #FFFFFF;
-	}
-	
-	.u-content {
-		padding: 30rpx;
-		line-height: 50rpx;
-		color: #505050;
-	}
-</style>

+ 1 - 9
pages/index/home.vue

@@ -81,24 +81,15 @@
 		</mescroll-body>
 		<!-- 海报 -->
 		<login ref="login" @signIn="signIn" @phoneSuccess="phoneSuccess"></login>
-		<poster ref="poster" :avatar="posetrParams.avatar" :title="posetrParams.title"
-			:subTitle="posetrParams.subTitle"></poster>
-		<uqrcode class="canvas-hide" ref="uqrcode"></uqrcode>
 		<toast ref="toast"></toast>
 	</view>
 </template>
 
 <script>
-	import poster from "@/components/poster/poster.vue"
-	import uqrcode from "@/components/uqrcode/uqrcode.vue"
 	import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
 	import util from "@/utils/util.js";
 	export default {
 		mixins: [MescrollMixin],
-		components: {
-			poster,
-			uqrcode
-		},
 		data() {
 			return {
 				downOption: {
@@ -232,6 +223,7 @@
 					this.gridList = gridList.filter(item=>item.show == 1)
 					this.gridClass='col-'+this.gridList.length
 				}
+				console.log(gridList,"gridList");
 				this.swiperList = this.vuex_active_setting.indexImageList
 			},
 			jump(item) {

+ 35 - 41
pages/introduce/notice.vue

@@ -1,69 +1,63 @@
 <template>
 	<view class="u-content">
 		<!-- #ifdef MP-WEIXIN -->
-		<u-navbar title-color="#000000"  :is-back="true" title="投票须知"></u-navbar>
+		<u-navbar title-color="#000000" :is-back="true" :title="title"></u-navbar>
 		<!-- #endif -->
-		 <mescroll-body ref="mescrollRef" @init="mescrollInit" :down="downOption" @down="downCallback" @up="upCallback">
-			<u-parse :html="content" ></u-parse>
-		</mescroll-body>
+		<u-parse :html="content" ></u-parse>
 	</view>
 </template>
 
 <script>
-	import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
 	export default {
-		mixins: [MescrollMixin],
 		data() {
 			return {
-				downOption:{
-					use:false,
-					auto:false
+				title:"",
+				downOption: {
+					use: false,
+					auto: false
 				},
-				content:'',
-				list: [] // 数据列表
+				content: '',
 			}
 		},
+		onLoad(options) {
+			this.title=options.title
+			console.log(this.title);
+			// #ifdef H5
+			uni.setNavigationBarTitle({
+				title:this.title,
+				success() {
+					console.log("success");
+				},
+				fail(err) {
+					console.log(err);
+				}
+			})
+			// #endif
+			
+			this.fetchDetail()
+		},
 		methods: {
-			downCallback(){
-				setTimeout(()=>{
-					this.mescroll.resetUpScroll();
-				},1000)
-			},
-			upCallback(mescroll) {
-				try {
-					let params={
-						title:'投票须知',
-						activeId:this.vuex_active_setting.defaultActiveId,
-						current:mescroll.num,
-						size:mescroll.size,
-					}
-					this.$api.notice.list(params).then(res => {
-						let data = res.data.data.records
-						let total = res.data.data.total
-						mescroll.endBySize(data.length, total);
-						if (mescroll.num == 1) this.list = []; //如果是第一页需手动制空列表
-						this.list = this.list.concat(data); //追加新数据
-						this.content = decodeURIComponent(this.list[0].content)
-					}).catch(err=>{
-						console.log(err);
-					})
-				} catch (e) {
-					console.error(e);
-					this.mescroll.endErr()
+			fetchDetail() {
+				let params = {
+					title: this.title,
+					activeId: this.vuex_active_setting.defaultActiveId,
 				}
+				this.$api.notice.getDetail(params).then(res => {
+					this.content = decodeURIComponent(res.data.data.content)
+				})
 			}
 		}
 	}
 </script>
 
-<style >
-	page{
+<style>
+	page {
 		background-color: #FFFFFF;
 	}
-	
+
 	.u-content {
 		padding: 30rpx;
 		line-height: 50rpx;
 		color: #505050;
 	}
-</style>
+</style>

+ 24 - 9
pages/mine/info/info.vue

@@ -30,24 +30,34 @@
 				</view>
 			</view>
 			<u-line color="#f1f1f1"></u-line>
+			<!-- #ifdef MP-WEIXIN -->
 			<view class="flex padding justify-between align-center">
 				<view class="title">手机号</view>
 				<view class="center">
 					<u-input disabled v-model="userData.phone" :placeholder-style="placeholderStyle" :clearable="false"
 						inputAlign="right" placeholder="请填写手机号码"></u-input>
-					<!-- #ifdef MP-WEIXIN -->
 					<button open-type="getPhoneNumber" @getphonenumber="getphonenumber"
 						class="cu-btn radius u-reset-button round bg-base sm"
 						style="padding: 8rpx 16rpx;font-size: 20rpx;margin-left: 30rpx;">
 						获取手机号
 					</button>
-					<!-- #endif -->
-					
-					<!-- #ifdef H5 -->
-					<text class="cuIcon-right margin-left-10" style="color: #CCCCCC;"></text>
-					<!-- #endif -->
 				</view>
 			</view>
+			<!-- #endif -->
+			<!-- #ifdef H5 -->
+			<view class="flex padding justify-between align-center">
+				<view class="title">手机号</view>
+				<view class="center">
+					<view class="center">
+						<u-input disabled v-model="userData.phone"  :placeholder-style="placeholderStyle" :clearable="false"
+							inputAlign="right" placeholder="请填写手机号码"></u-input>
+					</view>
+					<view  class="center  padding-bottom-10 padding-left-20">
+						<text class="text-base" >修改</text>
+					</view>
+				</view>
+			</view>
+			<!-- #endif -->
 		</view>
 
 		<view style="margin-top: 150rpx;" @click="confirm">
@@ -64,9 +74,14 @@
 		data() {
 			return {
 				placeholderStyle: 'color: #c0c4cc;font-size:26rpx',
-				isEdit: false,
-
-				userData: {},
+				userData: {
+					avatar: "",
+					nickName: "",
+					sex: "",
+					phone: "",
+					code: "",
+					smsId: ""
+				},
 				sexShow: false,
 				border: true,
 				show: false,

+ 1 - 1
pages/mine/mine.vue

@@ -148,7 +148,7 @@
 					{
 						name: '积分兑换规则',
 						icon: '/static/mine/guize.png',
-						url: '/pages/rule/point',
+						url: '/pages/introduce/notice?title=积分规则',
 						auth: false,
 						show: true
 					},

+ 10 - 5
pages/mine/points/pointsDetail.vue

@@ -7,8 +7,10 @@
 		<!-- #endif -->
 		<view class="">
 			<view class="bg-img flex justify-center align-center"
-				:style="'margin-top:'+marginTop"
-				style="background-image: url('https://vote.guosen-fumao.cn/obsfile/6002585ea7d548508d5f6dcce4ed1116-mingxi.png');height: 340upx;z-index: 9999999999999;">
+				:class="isH5?'marginTop':''"
+				style="background-image: url('https://vote.guosen-fumao.cn/obsfile/6002585ea7d548508d5f6dcce4ed1116-mingxi.png');
+				height: 340upx;z-index: 9999999999999;">
+
 				<view class="text-center" style="margin-top: 150upx;">
 					<view style="font-size: 26upx;color: #FFFFFF;font-weight: 400;">可用积分</view>
 					<view style="font-size: 58upx;margin-top: 7rpx;color: #ffffff;">
@@ -45,7 +47,7 @@
 		},
 		data() {
 			return {
-				marginTop:"0",
+				isH5:false,
 				userPoint: 0,
 				title: '积分明细',
 				backShow: true,
@@ -88,12 +90,11 @@
 			this.fetchUserPufaPoint()
 
 			// #ifdef MP-WEIXIN
-			this.marginTop='0'
 			this.mescroll.resetUpScroll();
 			// #endif
 
 			// #ifdef H5
-			this.marginTop='-80rpx'
+			this.isH5 = true
 			//h5端要延时才能获取到mescroll对象
 			setTimeout(() => {
 				this.mescroll.resetUpScroll();
@@ -145,6 +146,10 @@
 		border-radius: 10upx;
 		margin: 20upx;
 	}
+	
+	.marginTop{
+		margin-top: -80rpx;
+	}
 
 	.type {
 		font-size: 30upx;

+ 7 - 4
pages/rank/rank.vue

@@ -7,7 +7,7 @@
 			<back v-show="!navbarShow" :custom-back="customBack"></back>
 			<!-- #endif -->
 			<view class="bg-img flex-direction flex justify-center"
-				:style="'margin-top:'+marginTop"
+				:class="isH5?'marginTop':''"
 				style="background-image: url(https://guosen-bucket-ldt.obs.cn-south-1.myhuaweicloud.com:443/4872ea85f7e74a75a920135ce1384262-bg.png);height: 380rpx;">
 				<view class="title" style="padding: 80rpx 0 0 60rpx;">排行榜</view>
 			</view>
@@ -133,7 +133,7 @@
 		},
 		data() {
 			return {
-				marginTop:'0',
+				isH5:false,
 				
 				downOption: {
 					auto: false
@@ -161,12 +161,11 @@
 		onLoad(options) {
 			this.activeId = options.activeId
 			// #ifdef MP-WEIXIN
-			this.marginTop='0'
 			this.mescroll.resetUpScroll();
 			// #endif
 
 			// #ifdef H5
-			this.marginTop='-80rpx'
+			this.isH5=true
 			//h5端要延时才能获取到mescroll对象
 			setTimeout(() => {
 				this.mescroll.resetUpScroll();
@@ -213,6 +212,10 @@
 </script>
 
 <style lang="scss" scoped>
+	.marginTop{
+		margin-top: -80rpx;
+	}
+	
 	.search {
 		margin-top: -60upx;
 		width: 80%;

+ 0 - 69
pages/rule/point.vue

@@ -1,69 +0,0 @@
-<template>
-	<view class="u-content">
-		<!-- #ifdef MP-WEIXIN -->
-		<u-navbar title-color="#000000"  :is-back="true" title="积分规则"></u-navbar>
-		<!-- #endif -->
-		 <mescroll-body ref="mescrollRef" @init="mescrollInit" :down="downOption" @down="downCallback" @up="upCallback">
-			<u-parse :html="content" ></u-parse>
-		</mescroll-body>
-	</view>
-</template>
-
-<script>
-	import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
-	export default {
-		mixins: [MescrollMixin],
-		data() {
-			return {
-				downOption:{
-					use:false,
-					auto:false
-				},
-				content:'',
-				list: [] // 数据列表
-			}
-		},
-		methods: {
-			downCallback(){
-				setTimeout(()=>{
-					this.mescroll.resetUpScroll();
-				},1000)
-			},
-			upCallback(mescroll) {
-				try {
-					let params={
-						title:'积分规则',
-						activeId:this.vuex_active_setting.defaultActiveId,
-						current:mescroll.num,
-						size:mescroll.size,
-					}
-					this.$api.notice.list(params).then(res => {
-						let data = res.data.data.records
-						let total = res.data.data.total
-						mescroll.endBySize(data.length, total);
-						if (mescroll.num == 1) this.list = []; //如果是第一页需手动制空列表
-						this.list = this.list.concat(data); //追加新数据
-						this.content = decodeURIComponent(this.list[0].content)
-					}).catch(err=>{
-						console.log(err);
-					})
-				} catch (e) {
-					console.error(e);
-					this.mescroll.endErr()
-				}
-			}
-		}
-	}
-</script>
-
-<style >
-	page{
-		background-color: #FFFFFF;
-	}
-	
-	.u-content {
-		padding: 30rpx;
-		line-height: 50rpx;
-		color: #505050;
-	}
-</style>

+ 0 - 69
pages/rule/rule.vue

@@ -1,69 +0,0 @@
-<template>
-	<view class="u-content">
-		<!-- #ifdef MP-WEIXIN -->
-		<u-navbar title-color="#000000"  :is-back="true" title="活动规则"></u-navbar>
-		<!-- #endif -->
-		 <mescroll-body ref="mescrollRef" @init="mescrollInit" :down="downOption" @down="downCallback" @up="upCallback">
-			<u-parse :html="content" ></u-parse>
-		</mescroll-body>
-	</view>
-</template>
-
-<script>
-	import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
-	export default {
-		mixins: [MescrollMixin],
-		data() {
-			return {
-				downOption:{
-					use:false,
-					auto:false
-				},
-				content:'',
-				list: [] // 数据列表
-			}
-		},
-		methods: {
-			downCallback(){
-				setTimeout(()=>{
-					this.mescroll.resetUpScroll();
-				},1000)
-			},
-			upCallback(mescroll) {
-				try {
-					let params={
-						title:'活动规则',
-						activeId:this.vuex_active_setting.defaultActiveId,
-						current:mescroll.num,
-						size:mescroll.size,
-					}
-					this.$api.notice.list(params).then(res => {
-						let data = res.data.data.records
-						let total = res.data.data.total
-						mescroll.endBySize(data.length, total);
-						if (mescroll.num == 1) this.list = []; //如果是第一页需手动制空列表
-						this.list = this.list.concat(data); //追加新数据
-						this.content = decodeURIComponent(this.list[0].content)
-					}).catch(err=>{
-						console.log(err);
-					})
-				} catch (e) {
-					console.error(e);
-					this.mescroll.endErr()
-				}
-			}
-		}
-	}
-</script>
-
-<style >
-	page{
-		background-color: #FFFFFF;
-	}
-	
-	.u-content {
-		padding: 30rpx;
-		line-height: 50rpx;
-		color: #505050;
-	}
-</style>

+ 1 - 1
pages/shop/shop.vue

@@ -23,7 +23,7 @@
 						</view>
 					</view>
 					<view class="center" style="margin-right: -30rpx;">
-						<view class="cu-btn round sm rule" @click="$jump('/pages/rule/point')">
+						<view class="cu-btn round sm rule" @click="$jump('/pages/introduce/notice?title=积分规则')">
 							积分兑换规则
 						</view>
 					</view>

+ 27 - 2
utils/util.js

@@ -27,8 +27,8 @@ util.preview = async (src) => {
 			data: content
 		});
 	}
-	
-util.formatHtml=(str)=>{
+
+util.formatHtml = (str) => {
 	return decodeURIComponent(str).replace(/<[^>]+>/g, "");
 }
 
@@ -203,5 +203,30 @@ util.getBackParams = (paramsName) => {
 }
 
 
+/**
+ * vue中加载script
+ */
+util.loadScriptFunc = (url, callback) => {
+	callback = typeof callback === 'function' ? callback : function() {};
+	var head = document.getElementsByTagName('head')[0];
+	var script = document.createElement('script');
+	script.type = 'text/javascript';
+	script.src = url;
+	script.onreadystatechange = function() {
+		if (this.readyState == "loaded" || this.readyState == "complete") {
+			callback();
+		}
+	}
+	script.onload = callback;
+	head.appendChild(script);
+}
+
+util.loadScript = (src) => {
+	var script = document.createElement('script');
+	script.src = src;
+	document.body.appendChild(script);
+}
+
+
 
 export default util