瀏覽代碼

修改样式去掉顶部标题栏占位

lgh 1 年之前
父節點
當前提交
53733f6003

+ 6 - 0
App.vue

@@ -27,6 +27,12 @@
 					})
 				})
 			}
+			let accessToken = uni.getStorageSync('accessToken')
+			if(!accessToken){
+				uni.redirectTo({
+					url: '/pages/login/index'
+				})
+			}
 		},
 		onShow: function() {
 			console.log('App Show')

+ 10 - 1
pages.json

@@ -6,7 +6,7 @@
 		{
 			"path": "pages/gallery/index",
 			"style": {
-				"navigationBarTitleText": "工作台",
+				"navigationBarTitleText": "游戏币分销",
 				"navigationStyle": "custom"
 			}
 		},
@@ -77,6 +77,15 @@
 				"navigationBarTitleText": "账户充值记录"
 			}
 		}]
+	},{
+		"root": "pages/agree",
+		"pages": [{
+			"path": "index",
+			"style": {
+				"navigationStyle": "custom",
+				"navigationBarTitleText": "用户协议"
+			}
+		}]
 	}],
 	"globalStyle": {
 		"navigationBarTextStyle": "black",

+ 4 - 3
pages/accountRecharge/index.vue

@@ -8,8 +8,8 @@
             </view>
         </view>
         <view class="tabulation">
-            <mescroll-body height="100%" ref="mescrollRef" bottom="200" @init="mescrollInit" @down="downCallback" :up="upOption" @up="upCallback">
-                <view class="list" v-if="list.length">
+            <mescroll-body height="100%" ref="mescrollRef" bottom="100" @init="mescrollInit" @down="downCallback" :up="upOption" @up="upCallback">
+                <view class="list" v-show="list && list.length !== 0">
                     <view class="list-item" v-for="(item,index) in list" :key="index">
                         <view class="top flex aic jcsb">
                             <text class="word">{{item.packageName}}</text>
@@ -20,10 +20,11 @@
                             <text>有效期至:{{item.expireTime || '--'}}</text>
                             <text>赠送用户明细:<span v-if="item.trafficSize">赠送流量{{item.trafficSize}}M</span><span v-if="item.trafficSize && item.grabTimes">+</span><span v-if="item.grabTimes">红包机会x{{item.grabTimes}}</span></text>
                             <text>套餐金额:¥{{item.realPrice}}</text>
-                            <text>套餐折扣:{{item.deductionRatio || '--'}}</text>
+                            <text>套餐折扣:{{item.deductionRatio/10+'折' || '--'}}</text>
                             <text>实付金额:¥{{item.totalAmount || 0}}</text>
                             <text>预估收益:¥{{item.deduction || 0}}</text>
                             <text>充值时间:{{item.payTime || '--'}}</text>
+                            <text>订单编号:{{item.orderNo || '--'}}</text>
                         </view>
                     </view>
                 </view>

File diff suppressed because it is too large
+ 355 - 0
pages/agree/index.vue


+ 7 - 9
pages/gallery/index.vue

@@ -1,7 +1,7 @@
 <template>
 	<view class="gallery" :style="{background:'url('+ bannerImage +')#ffffff'}">
-		<view><nav-bar title="none" icon="none" background="transparent" border-color="transparent" ></nav-bar></view>
-		<view class="logo"><re-image imgSrc="/retail/main/img_logo.png" width="300" height="56"></re-image></view>
+		<view style="height: 160rpx;"></view>
+		<!-- <view class="logo"><re-image imgSrc="/retail/main/img_logo.png" width="300" height="56"></re-image></view> -->
 		<view class="content">
 			<view class="news">
 				<view class="info flex">
@@ -184,20 +184,20 @@
 		// background-position: top;
 		width: 100%;
 		position: absolute;
-		top: 0;
+		top: -160rpx;
 		bottom: 0;
 		.logo {
-			margin-top: 16rpx;
+			// margin-top: 16rpx;
 			margin-left: 24rpx;
 		}
 
 		.content {
-			padding: 0 32rpx var(--window-bottom);
+			padding: 32rpx 32rpx var(--window-bottom);
 			.news {
 				background: #FFFFFF;
 				box-shadow: 0rpx 6rpx 16rpx 0rpx #E3E6F2;
 				border-radius: 24rpx;
-				margin-top: 48rpx;
+				// margin-top: 48rpx;
 				padding: 40rpx;
 
 				.info {
@@ -400,9 +400,7 @@
 									overflow: hidden;
 									font-weight: normal;
 									font-size: 28rpx;
-									.num{
-
-									}
+									
 								}
 
 								.og {

+ 18 - 6
pages/mall/mallRecharge/index.vue

@@ -24,7 +24,7 @@
 					</view>
 					<view>
 						<span class="price-text">¥</span>
-						<span class="price-num">{{data.price}}</span>
+						<span class="price-num">{{data.realPrice}}</span>
 					</view>
 				</view>
 				<view class="info-msg flex jcsb aic">
@@ -90,14 +90,14 @@
 		<!-- 支付按钮 -->
 		<view class="btn-wrapper">
 			<view id="checkBox" class="margin-bottom-17">
-				<view class="check-text text-center">点击“确认支付”,即代表您已阅读并同意<span id="agreeEl" class="red">《用户购买协议》</span>
+				<view class="check-text text-center">点击“确认支付”,即代表您已阅读并同意<span class="red" @click="agreeEl">《用户购买协议》</span>
 				</view>
 			</view>
 			<view class="btns flex jcsb aic safe-area-inset-bottom">
 				<view>
 					<span class="btn-price-text1">应付款:</span>
 					<span class="btn-price-text2">¥</span>
-					<span class="price-num btn-price-num">{{data.price}}</span>
+					<span class="price-num btn-price-num">{{data.realPrice}}</span>
 				</view>
 				<u-button class="primary-btn" id="buyBtn" @click="confirm()">确认支付</u-button>
 			</view>
@@ -146,6 +146,7 @@
 				orderNo: '',
 				isPay:false,
 				wxOpenid:uni.getStorageSync('wxOpenid'),
+				payDate:''
 			}
 
 		},
@@ -167,7 +168,11 @@
 			// 		removeStorageSync('orderNo')
 			// 	}
 			// },
-
+			agreeEl(){
+				uni.navigateTo({
+					url:'/pages/agree/index'
+				})
+			},
 			// 获取日期
 			getDate() {
 				let today = new Date();
@@ -207,11 +212,13 @@
 					wxOpenid: this.wxOpenid
 				}
 				const res = await doPay(params)
+				this.payDate = new Date(res.timeStamp)
 				// let redirect_url = encodeURIComponent(
 				// 	`${config.wapUrl}pages/mall/mallRecharge/index?orderNo=${res.orderNo}`)
 				uni.hideLoading();
 				const payRes = await wxPay(res)
 				if (payRes) {
+					console.log(payRes,88);
 					this.polling(res.orderNo)
 					// uni.navigateTo({
 					// 	url: `/pages/mall/mallPay/index?mwebUrl=${res.mwebUrl}`
@@ -252,8 +259,13 @@
 					})
 					if (res) {
 						if (res.status === 1) {
+							let query = ''
+							for (let k in res) {
+								query += `${k}=${res[k]}&`
+							}
+							console.log(query,'query');
 							uni.navigateTo({
-								url: `/pages/mall/mallSuccess/index?gameCurrency=${this.data.gameCurrency}&price=${this.data.price}`
+								url: `/pages/mall/mallSuccess/index?${query}&price=${this.data.price}`
 							})
 						} else {
 							clearTimeout(this.timer)
@@ -488,7 +500,7 @@
 			color: #2C2B28;
 			font-weight: 500;
 
-			.date-wrapper {}
+			// .date-wrapper {}
 
 			.wx-ctrl {
 				margin-top: 78rpx;

+ 23 - 10
pages/mall/mallSuccess/index.vue

@@ -2,15 +2,18 @@
 	<view class="success">
 		<!-- <view class="bgc"></view> -->
 		<view class="content">
-			<view>
+			<!-- <view>
 				<nav-bar title="none" icon="none" background="transparent" border-color="transparent"></nav-bar>
-			</view>
+			</view> -->
 			<view class="sur flex-column aic">
 				<re-image imgSrc="/retail/mall/img_quancoin.png" width="240" height="240"></re-image>
 				<view class="texts flex-column">
 					<text class="suce-text">充值成功</text>
-					<text>支付金额:{{gameCurrency}}</text>
-					<text>购买游戏币:{{price}}</text>
+					<text>充值账号:{{phone}}</text>
+					<text>套餐金额:¥{{price}}</text>
+					<text>购买游戏币:{{gameCurrency}}</text>
+					<text>充值时间:{{createTime}}</text>
+					<text>订单号:{{orderNo}}</text>
 				</view>
 				<view class="btns">
 					<u-button class="order" @click="toOrder">查看订单</u-button>
@@ -25,17 +28,23 @@
 		data() {
 			return {
 				gameCurrency:'',
-				price:''
+				phone:'',
+				orderNo:'',
+				price:'',
+				createTime:''
 			}
 		},
 		onLoad(params){
 			this.gameCurrency = params.gameCurrency,
 			this.price = params.price
+			this.orderNo = params.orderNo
+			this.phone = params.phone
+			this.createTime = params.createTime
 		},
 		methods: {
 			// 返回订单
 			toOrder() {
-				uni.navigateTo({
+				uni.redirectTo({
 					url: '/pages/accountRecharge/index'
 				})
 			},
@@ -51,20 +60,24 @@
 	.success {
 		width: 100%;
 		position: relative;
-
-		.bgc {
+		display: flex;
+		flex-direction: column;
+		height: 100%;
+		// .bgc {
 			// position: absolute;
 
-		}
+		// }
 
 		.content {
 			// z-index: 9;
 			width: 100%;
-			height: 544rpx;
+			height: 100%;
+			// height: 544rpx;
 			background: linear-gradient(180deg, #FFF4D6 0%, rgba(255, 251, 193, 0.62) 40%, rgba(255, 221, 202, 0.32) 100%);
 			padding: 32rpx;
 
 			.sur {
+				height: 100%;
 				width: 100%;
 				padding: 56rpx 0 64rpx;
 				background: #FFFFFF;

+ 9 - 8
pages/my/index.vue

@@ -1,6 +1,6 @@
 <template>
 	<view class="my" :style="{background:'url('+ bannerImage +')'}">
-		<view><nav-bar title="none" icon="none" background="transparent" border-color="transparent" ></nav-bar></view>
+		<!-- <view><nav-bar title="none" icon="none" background="transparent" border-color="transparent" ></nav-bar></view> -->
 		<view class="content">
 			<view class="news flex jcsb">
 				<view class="info flex">
@@ -50,7 +50,7 @@
 					<p>长按或截图保存微信二维码</p>
 					<p>添加好友即可联系客服</p>
 				</view>
-				<image class="contact" :src='kefuImg' @longpress="saveImage"></image>
+				<image class="kefu-img" :src='kefuImg' @longpress="saveImage"></image>
 			</view>
 		</u-popup>
 	</view>
@@ -244,7 +244,7 @@
 		top: 0;
 		bottom: 0;
 		.content{
-			padding: 0 32rpx;
+			padding: 32rpx 32rpx 0;
 			.news {
 				.info {
 					.img{
@@ -294,7 +294,7 @@
 					display: flex;
 					justify-content: flex-end;
 					.more{
-						
+					
 						margin-top: 26rpx;
 					}
 				}
@@ -342,10 +342,11 @@
 			margin: 40rpx 0;
 		}
 		.kefu{
-			padding: 40rpx 0;
-			.contact{
-				flex-shrink: 0;
-				object-fit: contain;
+			padding: 40rpx;
+			.kefu-img{
+				object-fit: cover;
+				width: 400rpx;
+				height: 400rpx;
 			}
 			.tips {
 				margin-top: 40rpx;

+ 13 - 5
pages/news/index.vue

@@ -1,22 +1,24 @@
 <template>
 	<view class="news">
-		<mescroll-body height="100%" ref="mescrollRef" bottom="200" @init="mescrollInit" @down="downCallback" :up="upOption" @up="upCallback">
+		<mescroll-body height="100%" ref="mescrollRef" bottom="0" @init="mescrollInit" @down="downCallback" :up="upOption" @up="upCallback">
 			<view class="list">
-				<view class="list-item" v-for="(item,index) in list" :key="index">
+				<view class="list-item" v-for="(item,index) in list" :key="index" @click="toDetail(item.id)">
 					<view class="time">{{item.sendTime}}</view>
 					<view class="new-card">
 						<view class="news-cons">
 							<view class="name">{{item.title}}</view>
-							<view class="text ellipsis-2">{{item.msg}}</view>
+							<view class="text ellipsis-2">
+								<u-parse :content="item.msg" class="unscl ellipsis-2"></u-parse>
+							</view>
 						</view>
-						<view class="news-detail" @click="toDetail(item.id)">
+						<view class="news-detail">
 							<view class="txt">查看详情</view>
 							<re-image imgSrc="/retail/mall/icon_more.png" width="24" height="24"></re-image>
 						</view>
 					</view>
 				</view>
 			</view>
-			<no-data :statusType="2" :top="0" tipsText="暂无数据" v-if="!isInit&&!list.length"></no-data>
+			<no-data :statusType="3" :top="0" tipsText="暂无数据" v-if="!isInit&&!list.length"></no-data>
 		</mescroll-body>
 	</view>
 </template>
@@ -81,7 +83,9 @@ export default {
 <style lang="scss" scoped>
 .news{
 	padding: 0 20rpx;
+	
 	.list{
+		// height: 100%;
 		.list-item{
 			margin-top: 48rpx;
 			.time{
@@ -105,6 +109,10 @@ export default {
 					.text{
 						font-size: 28rpx;
 						color: #7C7C7B;
+						overflow: hidden;
+						.unscl{
+							overflow: hidden;
+						}
 					}
 				}
 				.news-detail{

+ 8 - 9
pages/statistics/index.vue

@@ -1,8 +1,7 @@
 <template>
 	<view class="statistics" :style="{background:'url('+ bannerImage +')'}">
-		<view><nav-bar title="none" icon="none" background="transparent" border-color="transparent"
-				></nav-bar></view>
-		<view class="logo"><re-image imgSrc="/retail/main/img_logo.png" width="300" height="56"></re-image></view>
+		<!-- <view><nav-bar title="none" icon="none" background="transparent" border-color="transparent"></nav-bar></view> -->
+		<view style="height: 160rpx;"></view>
 		<view class="content">
 			<view class="news">
 				<view class="info flex">
@@ -78,7 +77,7 @@
 					<view class="left_dec flex aic">
 						<re-image width="40" height="40" imgSrc="/retail/statistics/ic_yeji.png"></re-image><text style="margin-left: 16rpx">分销等级说明</text>
 					</view>
-					<rich-text :nodes="nodes"></rich-text>
+					<u-parse :content="nodes"></u-parse>
 				</view>
 			</view>
 		</view>
@@ -207,22 +206,22 @@
 		// background-position: top;
 		width: 100%;
 		position: absolute;
-		top: 0;
+		top: -160rpx;
 		bottom: 0;
 
 		.logo {
-			margin-top: 16rpx;
+			// margin-top: 16rpx;
 			margin-left: 24rpx;
 		}
 
 		.content {
-			padding: 0 32rpx;
+			padding: 32rpx 32rpx var(--window-bottom);
 
 			.news {
 				background: #FFFFFF;
 				box-shadow: 0rpx 6rpx 16rpx 0rpx #E3E6F2;
 				border-radius: 24rpx;
-				margin-top: 48rpx;
+				// margin-top: 48rpx;
 				padding: 40rpx;
 
 				.info {
@@ -342,7 +341,7 @@
 				padding: 32rpx;
 				background: linear-gradient( 135deg, #FFDFDF 0%, #FFE4A4 100%);
 				border-radius: 24rpx;
-				margin-top: 22rpx;
+				margin: 22rpx 0;
 				.left_dec{
 					margin-bottom: 28rpx;
 				}

+ 1 - 2
pages/system/index.vue

@@ -1,10 +1,9 @@
 <template>
     <view class="system">
-        <view><nav-bar title="none" icon="none" background="transparent" border-color="transparent" ></nav-bar></view>
         <view class="content">
             <view class="title bold">{{title}}</view>
             <view class="time">{{sendTime}}</view>
-            <view class="text">{{msg}}</view>
+            <u-parse :content="msg"></u-parse>
         </view>
     </view>
 </template>

+ 499 - 0
plugins/uview-ui/components/u-parse/node/node.vue

@@ -0,0 +1,499 @@
+<template>
+  <view :id="attrs.id" :class="'_'+name+' '+attrs.class" :style="attrs.style">
+    <block v-for="(n, i) in childs" v-bind:key="i">
+      <!-- 图片 -->
+      <!-- 占位图 -->
+      <image v-if="n.name=='img'&&((opts[1]&&!ctrl[i])||ctrl[i]<0)" class="_img" :style="n.attrs.style" :src="ctrl[i]<0?opts[2]:opts[1]" mode="widthFix" />
+      <!-- 显示图片 -->
+      <!-- #ifdef H5 || APP-PLUS -->
+      <img v-if="n.name=='img'" :id="n.attrs.id" :class="'_img '+n.attrs.class" :style="(ctrl[i]==-1?'display:none;':'')+n.attrs.style" :src="n.attrs.src||(ctrl.load?n.attrs['data-src']:'')" :data-i="i" @load="imgLoad" @error="mediaError" @tap.stop="imgTap" @longpress="imgLongTap"/>
+      <!-- #endif -->
+      <!-- #ifndef H5 || APP-PLUS -->
+      <image v-if="n.name=='img'" :id="n.attrs.id" :class="'_img '+n.attrs.class" :style="(ctrl[i]==-1?'display:none;':'')+'width:'+(ctrl[i]||1)+'px;height:1px;'+n.attrs.style" :src="n.attrs.src" :mode="n.h?'':'widthFix'" :lazy-load="opts[0]" :webp="n.webp" :show-menu-by-longpress="opts[3]&&!n.attrs.ignore" :image-menu-prevent="!opts[3]||n.attrs.ignore" :data-i="i" @load="imgLoad" @error="mediaError" @tap.stop="imgTap" @longpress="imgLongTap" />
+      <!-- #endif -->
+      <!-- 文本 -->
+      <!-- #ifndef MP-BAIDU -->
+      <text v-else-if="n.type=='text'" decode>{{n.text}}</text>
+      <!-- #endif -->
+      <text v-else-if="n.name=='br'">\n</text>
+      <!-- 链接 -->
+      <view v-else-if="n.name=='a'" :id="n.attrs.id" :class="(n.attrs.href?'_a ':'')+n.attrs.class" hover-class="_hover" :style="'display:inline;'+n.attrs.style" :data-i="i" @tap.stop="linkTap">
+        <node name="span" :childs="n.children" :opts="opts" style="display:inherit" />
+      </view>
+      <!-- 视频 -->
+      <!-- #ifdef APP-PLUS -->
+      <view v-else-if="n.html" :id="n.attrs.id" :class="'_video '+n.attrs.class" :style="n.attrs.style" v-html="n.html" />
+      <!-- #endif -->
+      <!-- #ifndef APP-PLUS -->
+      <video v-else-if="n.name=='video'" :id="n.attrs.id" :class="n.attrs.class" :style="n.attrs.style" :autoplay="n.attrs.autoplay" :controls="n.attrs.controls" :loop="n.attrs.loop" :muted="n.attrs.muted" :poster="n.attrs.poster" :src="n.src[ctrl[i]||0]" :data-i="i" @play="play" @error="mediaError" />
+      <!-- #endif -->
+      <!-- #ifdef H5 || APP-PLUS -->
+      <iframe v-else-if="n.name=='iframe'" :style="n.attrs.style" :allowfullscreen="n.attrs.allowfullscreen" :frameborder="n.attrs.frameborder" :src="n.attrs.src" />
+      <embed v-else-if="n.name=='embed'" :style="n.attrs.style" :src="n.attrs.src" />
+      <!-- #endif -->
+      <!-- #ifndef MP-TOUTIAO -->
+      <!-- 音频 -->
+      <audio v-else-if="n.name=='audio'" :id="n.attrs.id" :class="n.attrs.class" :style="n.attrs.style" :author="n.attrs.author" :controls="n.attrs.controls" :loop="n.attrs.loop" :name="n.attrs.name" :poster="n.attrs.poster" :src="n.src[ctrl[i]||0]" :data-i="i" @play="play" @error="mediaError" />
+      <!-- #endif -->
+      <view v-else-if="(n.name=='table'&&n.c)||n.name=='li'" :id="n.attrs.id" :class="'_'+n.name+' '+n.attrs.class" :style="n.attrs.style">
+        <node v-if="n.name=='li'" :childs="n.children" :opts="opts" />
+        <view v-else v-for="(tbody, x) in n.children" v-bind:key="x" :class="'_'+tbody.name+' '+tbody.attrs.class" :style="tbody.attrs.style">
+          <node v-if="tbody.name=='td'||tbody.name=='th'" :childs="tbody.children" :opts="opts" />
+          <block v-else v-for="(tr, y) in tbody.children" v-bind:key="y">
+            <view v-if="tr.name=='td'||tr.name=='th'" :class="'_'+tr.name+' '+tr.attrs.class" :style="tr.attrs.style">
+              <node :childs="tr.children" :opts="opts" />
+            </view>
+            <view v-else :class="'_'+tr.name+' '+tr.attrs.class" :style="tr.attrs.style">
+              <view v-for="(td, z) in tr.children" v-bind:key="z" :class="'_'+td.name+' '+td.attrs.class" :style="td.attrs.style">
+                <node :childs="td.children" :opts="opts" />
+              </view>
+            </view>
+          </block>
+        </view>
+      </view>
+      
+      <!-- 富文本 -->
+      <!-- #ifdef H5 || MP-WEIXIN || MP-QQ || APP-PLUS || MP-360 -->
+      <rich-text v-else-if="handler.use(n)" :id="n.attrs.id" :style="n.f" :nodes="[n]" />
+      <!-- #endif -->
+      <!-- #ifndef H5 || MP-WEIXIN || MP-QQ || APP-PLUS || MP-360 -->
+      <rich-text v-else-if="!n.c" :id="n.attrs.id" :style="n.f+';display:inline'" :preview="false" :nodes="[n]" />
+      <!-- #endif -->
+      <!-- 继续递归 -->
+      <view v-else-if="n.c==2" :id="n.attrs.id" :class="'_'+n.name+' '+n.attrs.class" :style="n.f+';'+n.attrs.style">
+        <node v-for="(n2, j) in n.children" v-bind:key="j" :style="n2.f" :name="n2.name" :attrs="n2.attrs" :childs="n2.children" :opts="opts" />
+      </view>
+      <node v-else :style="n.f" :name="n.name" :attrs="n.attrs" :childs="n.children" :opts="opts" />
+    </block>
+  </view>
+</template>
+<script module="handler" lang="wxs">
+// 行内标签列表
+var inlineTags = {
+  abbr: true,
+  b: true,
+  big: true,
+  code: true,
+  del: true,
+  em: true,
+  i: true,
+  ins: true,
+  label: true,
+  q: true,
+  small: true,
+  span: true,
+  strong: true,
+  sub: true,
+  sup: true
+}
+/**
+ * @description 是否使用 rich-text 显示剩余内容
+ */
+module.exports = {
+  use: function (item) {
+  // 微信和 QQ 的 rich-text inline 布局无效
+  if (inlineTags[item.name] || (item.attrs.style || '').indexOf('display:inline') != -1)
+    return false
+  return !item.c
+  }
+}
+</script>
+<script>
+
+import node from './node'
+export default {
+  name: 'node',
+  // #ifdef MP-WEIXIN
+  options: {
+    virtualHost: true
+  },
+  // #endif
+  data() {
+    return {
+      ctrl: {}
+    }
+  },
+  props: {
+    name: String,
+    attrs: {
+      type: Object,
+      default() {
+        return {}
+      }
+    },
+    childs: Array,
+    opts: Array
+  },
+  components: {
+
+    node
+  },
+  mounted() {
+    for (this.root = this.$parent; this.root.$options.name != 'mp-html'; this.root = this.root.$parent);
+    // #ifdef H5 || APP-PLUS
+    if (this.opts[0]) {
+      for (var i = this.childs.length; i--;)
+        if (this.childs[i].name == 'img')
+          break
+      if (i != -1) {
+        this.observer = uni.createIntersectionObserver(this).relativeToViewport({
+          top: 500,
+          bottom: 500
+        })
+        this.observer.observe('._img', res => {
+          if (res.intersectionRatio) {
+            this.$set(this.ctrl, 'load', 1)
+            this.observer.disconnect()
+          }
+        })
+      }
+    }
+    // #endif
+  },
+  beforeDestroy() {
+    // #ifdef H5 || APP-PLUS
+    if (this.observer)
+      this.observer.disconnect()
+    // #endif
+  },
+  methods:{
+    // #ifdef MP-WEIXIN
+    toJSON() { },
+    // #endif
+    /**
+     * @description 播放视频事件
+     * @param {Event} e 
+     */
+    play(e) {
+      // #ifndef APP-PLUS
+      if (this.root.pauseVideo) {
+        var flag = false, id = e.target.id
+        for (var i = this.root._videos.length; i--;) {
+          if (this.root._videos[i].id == id)
+            flag = true
+          else
+            this.root._videos[i].pause() // 自动暂停其他视频
+        }
+        // 将自己加入列表
+        if (!flag) {
+          var ctx = uni.createVideoContext(id
+            // #ifndef MP-BAIDU
+            , this
+            // #endif
+          )
+          ctx.id = id
+          this.root._videos.push(ctx)
+        }
+      }
+      // #endif
+    },
+
+    /**
+     * @description 图片点击事件
+     * @param {Event} e 
+     */
+    imgTap(e) {
+      var node = this.childs[e.currentTarget.dataset.i]
+      if (node.a)
+        return this.linkTap(node.a)
+      if (node.attrs.ignore)
+        return
+      // #ifdef H5 || APP-PLUS
+      node.attrs.src = node.attrs.src || node.attrs['data-src']
+      // #endif
+      this.root.$emit('imgTap', node.attrs)
+      // 自动预览图片
+      if (this.root.previewImg)
+        uni.previewImage({
+          current: parseInt(node.attrs.i),
+          urls: this.root.imgList
+        })
+    },
+
+    /**
+     * @description 图片长按
+     */
+    imgLongTap(e) {
+      // #ifdef APP-PLUS
+      var attrs = this.childs[e.currentTarget.dataset.i].attrs
+      if (!attrs.ignore)
+        uni.showActionSheet({
+          itemList: ['保存图片'],
+          success: () => {
+            uni.downloadFile({
+              url: this.root.imgList[attrs.i],
+              success: res => {
+                uni.saveImageToPhotosAlbum({
+                  filePath: res.tempFilePath,
+                  success() {
+                    uni.showToast({
+                      title: '保存成功'
+                    })
+                  }
+                })
+              }
+            })
+          }
+        })
+      // #endif
+    },
+
+    /**
+     * @description 图片加载完成事件
+     * @param {Event} e 
+     */
+    imgLoad(e) {
+      var i = e.currentTarget.dataset.i
+      // #ifndef H5 || APP-PLUS
+      // 设置原宽度
+      if (!this.childs[i].w)
+        this.$set(this.ctrl, i, e.detail.width)
+      else
+        // #endif
+        // 加载完毕,取消加载中占位图
+        if ((this.opts[1] && !this.ctrl[i]) || this.ctrl[i] == -1)
+          this.$set(this.ctrl, i, 1)
+    },
+
+    /**
+     * @description 链接点击事件
+     * @param {Event} e 
+     */
+    linkTap(e) {
+      var attrs = e.currentTarget ? this.childs[e.currentTarget.dataset.i].attrs : e,
+        href = attrs.href
+      this.root.$emit('linkTap', attrs)
+      if (href) {
+        // 跳转锚点
+        if (href[0] == '#')
+          this.root.navigateTo(href.substring(1)).catch(() => { })
+        // 复制外部链接
+        else if (href.includes('://')) {
+          if (this.root.copyLink) {
+            // #ifdef H5
+            window.open(href)
+            // #endif
+            // #ifdef MP
+            uni.setClipboardData({
+              data: href,
+              success: () =>
+                uni.showToast({
+                  title: '链接已复制'
+                })
+            })
+            // #endif
+            // #ifdef APP-PLUS
+            plus.runtime.openWeb(href)
+            // #endif
+          }
+        }
+        // 跳转页面
+        else
+          uni.navigateTo({
+            url: href,
+            fail() {
+              uni.switchTab({
+                url: href,
+                fail() { }
+              })
+            }
+          })
+      }
+    },
+
+    /**
+     * @description 错误事件
+     * @param {Event} e 
+     */
+    mediaError(e) {
+      var i = e.currentTarget.dataset.i,
+        node = this.childs[i]
+      // 加载其他源
+      if (node.name == 'video' || node.name == 'audio') {
+        var index = (this.ctrl[i] || 0) + 1
+        if (index > node.src.length)
+          index = 0
+        if (index < node.src.length)
+          return this.$set(this.ctrl, i, index)
+      }
+      // 显示错误占位图
+      else if (node.name == 'img' && this.opts[2])
+        this.$set(this.ctrl, i, -1)
+      if (this.root)
+        this.root.$emit('error', {
+          source: node.name,
+          attrs: node.attrs,
+          errMsg: e.detail.errMsg
+        })
+    }
+  }
+}
+</script>
+<style>
+/* a 标签默认效果 */
+._a {
+  padding: 1.5px 0 1.5px 0;
+  color: #366092;
+  word-break: break-all;
+}
+
+/* a 标签点击态效果 */
+._hover {
+  text-decoration: underline;
+  opacity: 0.7;
+}
+
+/* 图片默认效果 */
+._img {
+  max-width: 100%;
+  -webkit-touch-callout: none;
+}
+
+/* 内部样式 */
+
+._b,
+._strong {
+  font-weight: bold;
+}
+
+._code {
+  font-family: monospace;
+}
+
+._del {
+  text-decoration: line-through;
+}
+
+._em,
+._i {
+  font-style: italic;
+}
+
+._h1 {
+  font-size: 2em;
+}
+
+._h2 {
+  font-size: 1.5em;
+}
+
+._h3 {
+  font-size: 1.17em;
+}
+
+._h5 {
+  font-size: 0.83em;
+}
+
+._h6 {
+  font-size: 0.67em;
+}
+
+._h1,
+._h2,
+._h3,
+._h4,
+._h5,
+._h6 {
+  display: block;
+  font-weight: bold;
+}
+
+._image {
+  height: 1px;
+}
+
+._ins {
+  text-decoration: underline;
+}
+
+._li {
+  display: list-item;
+}
+
+._ol {
+  list-style-type: decimal;
+}
+
+._ol,
+._ul {
+  display: block;
+  padding-left: 40px;
+  margin: 1em 0;
+}
+
+._q::before {
+  content: '"';
+}
+
+._q::after {
+  content: '"';
+}
+
+._sub {
+  font-size: smaller;
+  vertical-align: sub;
+}
+
+._sup {
+  font-size: smaller;
+  vertical-align: super;
+}
+
+._thead,
+._tbody,
+._tfoot {
+  display: table-row-group;
+}
+
+._tr {
+  display: table-row;
+}
+
+._td,
+._th {
+  display: table-cell;
+  vertical-align: middle;
+}
+
+._th {
+  font-weight: bold;
+  text-align: center;
+}
+
+._ul {
+  list-style-type: disc;
+}
+
+._ul ._ul {
+  margin: 0;
+  list-style-type: circle;
+}
+
+._ul ._ul ._ul {
+  list-style-type: square;
+}
+
+._abbr,
+._b,
+._code,
+._del,
+._em,
+._i,
+._ins,
+._label,
+._q,
+._span,
+._strong,
+._sub,
+._sup {
+  display: inline;
+}
+
+/* #ifdef APP-PLUS */
+._video {
+  width: 300px;
+  height: 225px;
+}
+/* #endif */
+</style>

File diff suppressed because it is too large
+ 1075 - 0
plugins/uview-ui/components/u-parse/parser.js


+ 45 - 0
plugins/uview-ui/components/u-parse/props.js

@@ -0,0 +1,45 @@
+export default {
+    props: {
+        // #ifdef APP-PLUS-NVUE
+        bgColor: String,
+        // #endif
+        content: String,
+        copyLink: {
+		  type: Boolean,
+		  default: uni.$u.props.parse.copyLink
+        },
+        domain: String,
+        errorImg: {
+		  type: String,
+		  default: uni.$u.props.parse.errorImg
+        },
+        lazyLoad: {
+		  type: Boolean,
+		  default: uni.$u.props.parse.lazyLoad
+        },
+        loadingImg: {
+		  type: String,
+		  default: uni.$u.props.parse.loadingImg
+        },
+        pauseVideo: {
+		  type: Boolean,
+		  default: uni.$u.props.parse.pauseVideo
+        },
+        previewImg: {
+		  type: Boolean,
+		  default: uni.$u.props.parse.previewImg
+        },
+        scrollTable: Boolean,
+        selectable: Boolean,
+        setTitle: {
+		  type: Boolean,
+		  default: uni.$u.props.parse.setTitle
+        },
+        showImgMenu: {
+		  type: Boolean,
+		  default: uni.$u.props.parse.showImgMenu
+        },
+        tagStyle: Object,
+        useAnchor: null
+	  }
+}

+ 366 - 0
plugins/uview-ui/components/u-parse/u-parse.vue

@@ -0,0 +1,366 @@
+<template>
+  <view id="_root" :class="(selectable?'_select ':'')+'_root'">
+    <slot v-if="!nodes[0]" />
+    <!-- #ifndef APP-PLUS-NVUE -->
+    <node v-else :childs="nodes" :opts="[lazyLoad,loadingImg,errorImg,showImgMenu]" />
+    <!-- #endif -->
+    <!-- #ifdef APP-PLUS-NVUE -->
+    <web-view ref="web" src="/static/app-plus/mp-html/local.html" :style="'margin-top:-2px;height:' + height + 'px'" @onPostMessage="_onMessage" />
+    <!-- #endif -->
+  </view>
+</template>
+
+<script>
+	import props from './props.js';
+/**
+ * mp-html v2.0.4
+ * @description 富文本组件
+ * @tutorial https://github.com/jin-yufeng/mp-html
+ * @property {String}			bgColor		背景颜色,只适用与APP-PLUS-NVUE
+ * @property {String}			content		用于渲染的富文本字符串(默认 true )
+ * @property {Boolean}			copyLink	是否允许外部链接被点击时自动复制
+ * @property {String}			domain		主域名,用于拼接链接
+ * @property {String}			errorImg	图片出错时的占位图链接
+ * @property {Boolean}			lazyLoad	是否开启图片懒加载(默认 true )
+ * @property {string}			loadingImg	图片加载过程中的占位图链接
+ * @property {Boolean}			pauseVideo	是否在播放一个视频时自动暂停其它视频(默认 true )
+ * @property {Boolean}			previewImg	是否允许图片被点击时自动预览(默认 true )
+ * @property {Boolean}			scrollTable	是否给每个表格添加一个滚动层使其能单独横向滚动
+ * @property {Boolean}			selectable	是否开启长按复制
+ * @property {Boolean}			setTitle	是否将 title 标签的内容设置到页面标题(默认 true )
+ * @property {Boolean}			showImgMenu	是否允许图片被长按时显示菜单(默认 true )
+ * @property {Object}			tagStyle	标签的默认样式
+ * @property {Boolean | Number}	useAnchor	是否使用锚点链接
+ * 
+ * @event {Function}	load	dom 结构加载完毕时触发
+ * @event {Function}	ready	所有图片加载完毕时触发
+ * @event {Function}	imgTap	图片被点击时触发
+ * @event {Function}	linkTap	链接被点击时触发
+ * @event {Function}	error	媒体加载出错时触发
+ */
+const plugins=[]
+const parser = require('./parser')
+// #ifndef APP-PLUS-NVUE
+import node from './node/node'
+// #endif
+// #ifdef APP-PLUS-NVUE
+const dom = weex.requireModule('dom')
+// #endif
+export default {
+  name: 'mp-html',
+  data() {
+    return {
+      nodes: [],
+      // #ifdef APP-PLUS-NVUE
+      height: 0
+      // #endif
+    }
+  },
+  mixins:[props],
+  // #ifndef APP-PLUS-NVUE
+  components: {
+    node
+  },
+  // #endif
+  watch: {
+    content(content) {
+      this.setContent(content)
+    }
+  },
+  created() {
+    this.plugins = []
+    for (let i = plugins.length; i--;)
+      this.plugins.push(new plugins[i](this))
+  },
+  mounted() {
+    if (this.content && !this.nodes.length)
+      this.setContent(this.content)
+  },
+  beforeDestroy() {
+    this._hook('onDetached')
+    clearInterval(this._timer)
+  },
+  methods: {
+    /**
+     * @description 将锚点跳转的范围限定在一个 scroll-view 内
+     * @param {Object} page scroll-view 所在页面的示例
+     * @param {String} selector scroll-view 的选择器
+     * @param {String} scrollTop scroll-view scroll-top 属性绑定的变量名
+     */
+    in(page, selector, scrollTop) {
+      // #ifndef APP-PLUS-NVUE
+      if (page && selector && scrollTop)
+        this._in = {
+          page,
+          selector,
+          scrollTop
+        }
+      // #endif
+    },
+
+    /**
+     * @description 锚点跳转
+     * @param {String} id 要跳转的锚点 id
+     * @param {Number} offset 跳转位置的偏移量
+     * @returns {Promise}
+     */
+    navigateTo(id, offset) {
+      return new Promise((resolve, reject) => {
+        if (!this.useAnchor)
+          return reject('Anchor is disabled')
+        offset = offset || parseInt(this.useAnchor) || 0
+        // #ifdef APP-PLUS-NVUE
+        if (!id) {
+          dom.scrollToElement(this.$refs.web, {
+            offset
+          })
+          resolve()
+        } else {
+          this._navigateTo = {
+            resolve,
+            reject,
+            offset
+          }
+          this.$refs.web.evalJs('uni.postMessage({data:{action:"getOffset",offset:(document.getElementById(' + id + ')||{}).offsetTop}})')
+        }
+        // #endif
+        // #ifndef APP-PLUS-NVUE
+        let deep = ' '
+        // #ifdef MP-WEIXIN || MP-QQ || MP-TOUTIAO
+        deep = '>>>'
+        // #endif
+        const selector = uni.createSelectorQuery()
+          // #ifndef MP-ALIPAY
+          .in(this._in ? this._in.page : this)
+          // #endif
+          .select((this._in ? this._in.selector : '._root') + (id ? `${deep}#${id}` : '')).boundingClientRect()
+        if (this._in)
+          selector.select(this._in.selector).scrollOffset()
+            .select(this._in.selector).boundingClientRect() // 获取 scroll-view 的位置和滚动距离
+        else
+          selector.selectViewport().scrollOffset() // 获取窗口的滚动距离
+        selector.exec(res => {
+          if (!res[0])
+            return reject('Label not found')
+          const scrollTop = res[1].scrollTop + res[0].top - (res[2] ? res[2].top : 0) + offset
+          if (this._in)
+            // scroll-view 跳转
+            this._in.page[this._in.scrollTop] = scrollTop
+          else
+            // 页面跳转
+            uni.pageScrollTo({
+              scrollTop,
+              duration: 300
+            })
+          resolve()
+        })
+        // #endif
+      })
+    },
+
+    /**
+     * @description 获取文本内容
+     * @return {String}
+     */
+    getText() {
+      let text = '';
+      (function traversal(nodes) {
+        for (let i = 0; i < nodes.length; i++) {
+          const node = nodes[i]
+          if (node.type == 'text')
+            text += node.text.replace(/&amp;/g, '&')
+          else if (node.name == 'br')
+            text += '\n'
+          else {
+            // 块级标签前后加换行
+            const isBlock = node.name == 'p' || node.name == 'div' || node.name == 'tr' || node.name == 'li' || (node.name[0] == 'h' && node.name[1] > '0' && node.name[1] < '7')
+            if (isBlock && text && text[text.length - 1] != '\n')
+              text += '\n'
+            // 递归获取子节点的文本
+            if (node.children)
+              traversal(node.children)
+            if (isBlock && text[text.length - 1] != '\n')
+              text += '\n'
+            else if (node.name == 'td' || node.name == 'th')
+              text += '\t'
+          }
+        }
+      })(this.nodes)
+      return text
+    },
+
+    /**
+     * @description 获取内容大小和位置
+     * @return {Promise}
+     */
+    getRect() {
+      return new Promise((resolve, reject) => {
+        uni.createSelectorQuery()
+          // #ifndef MP-ALIPAY
+          .in(this)
+          // #endif
+          .select('#_root').boundingClientRect().exec(res => res[0] ? resolve(res[0]) : reject('Root label not found'))
+      })
+    },
+
+    /**
+     * @description 设置内容
+     * @param {String} content html 内容
+     * @param {Boolean} append 是否在尾部追加
+     */
+    setContent(content, append) {
+      if (!append || !this.imgList)
+        this.imgList = []
+      const nodes = new parser(this).parse(content)
+      // #ifdef APP-PLUS-NVUE
+      if (this._ready)
+        this._set(nodes, append)
+      // #endif
+      this.$set(this, 'nodes', append ? (this.nodes || []).concat(nodes) : nodes)
+
+      // #ifndef APP-PLUS-NVUE
+      this._videos = []
+      this.$nextTick(() => {
+        this._hook('onLoad')
+        this.$emit('load')
+      })
+
+      // 等待图片加载完毕
+      let height
+      clearInterval(this._timer)
+      this._timer = setInterval(() => {
+        this.getRect().then(rect => {
+          // 350ms 总高度无变化就触发 ready 事件
+          if (rect.height == height) {
+            this.$emit('ready', rect)
+            clearInterval(this._timer)
+          }
+          height = rect.height
+        }).catch(() => { })
+      }, 350)
+      // #endif
+    },
+
+    /**
+     * @description 调用插件钩子函数
+     */
+    _hook(name) {
+      for (let i = plugins.length; i--;)
+        if (this.plugins[i][name])
+          this.plugins[i][name]()
+    },
+
+    // #ifdef APP-PLUS-NVUE
+    /**
+     * @description 设置内容
+     */
+    _set(nodes, append) {
+      this.$refs.web.evalJs('setContent(' + JSON.stringify(nodes) + ',' + JSON.stringify([this.bgColor, this.errorImg, this.loadingImg, this.pauseVideo, this.scrollTable, this.selectable]) + ',' + append + ')')
+    },
+
+    /**
+     * @description 接收到 web-view 消息
+     */
+    _onMessage(e) {
+      const message = e.detail.data[0]
+      switch (message.action) {
+        // web-view 初始化完毕
+        case 'onJSBridgeReady':
+          this._ready = true
+          if (this.nodes)
+            this._set(this.nodes)
+          break
+        // 内容 dom 加载完毕
+        case 'onLoad':
+          this.height = message.height
+          this._hook('onLoad')
+          this.$emit('load')
+          break
+        // 所有图片加载完毕
+        case 'onReady':
+          this.getRect().then(res => {
+            this.$emit('ready', res)
+          }).catch(() => { })
+          break
+        // 总高度发生变化
+        case 'onHeightChange':
+          this.height = message.height
+          break
+        // 图片点击
+        case 'onImgTap':
+          this.$emit('imgTap', message.attrs)
+          if (this.previewImg)
+            uni.previewImage({
+              current: parseInt(message.attrs.i),
+              urls: this.imgList
+            })
+          break
+        // 链接点击
+        case 'onLinkTap':
+          const href = message.attrs.href
+          this.$emit('linkTap', message.attrs)
+          if (href) {
+            // 锚点跳转
+            if (href[0] == '#') {
+              if (this.useAnchor)
+                dom.scrollToElement(this.$refs.web, {
+                  offset: message.offset
+                })
+            }
+            // 打开外链
+            else if (href.includes('://')) {
+              if (this.copyLink)
+                plus.runtime.openWeb(href)
+            }
+            else
+              uni.navigateTo({
+                url: href,
+                fail() {
+                  wx.switchTab({
+                    url: href
+                  })
+                }
+              })
+          }
+          break
+        // 获取到锚点的偏移量
+        case 'getOffset':
+          if (typeof message.offset == 'number') {
+            dom.scrollToElement(this.$refs.web, {
+              offset: message.offset + this._navigateTo.offset
+            })
+            this._navigateTo.resolve()
+          } else
+            this._navigateTo.reject('Label not found')
+          break
+        // 点击
+        case 'onClick':
+          this.$emit('tap')
+          break
+        // 出错
+        case 'onError':
+          this.$emit('error', {
+            source: message.source,
+            attrs: message.attrs
+          })
+      }
+    }
+    // #endif
+  }
+}
+</script>
+
+<style>
+/* #ifndef APP-PLUS-NVUE */
+/* 根节点样式 */
+._root {
+  overflow: auto;
+  -webkit-overflow-scrolling: touch;
+}
+
+/* 长按复制 */
+._select {
+  user-select: text;
+}
+/* #endif */
+</style>

+ 10 - 10
store/modules/info.js

@@ -1,18 +1,18 @@
 export default {
 	state: {
-		token: "",
-		userId: "",
+		accessToken: "",
+		userInfo: {},
 		versionInfo: null, // 版本信息
 		systemInfo: null, // 系统信息
 		packageEnv: 'prod', // 默认产线环境
 	},
 	mutations: {
 		INIT_DATA(state, data = {}) {
-			let token = uni.getStorageSync('token')
-			let userId = uni.getStorageSync('userId')
-			if (token && userId) {
-				state.token = token
-				state.userId = userId
+			let accessToken = uni.getStorageSync('accessToken')
+			let userInfo = uni.getStorageSync('userInfo')
+			if (accessToken && userInfo) {
+				state.accessToken = accessToken
+				state.userInfo = userInfo
 			}
 		},
 		SET_PACKAGEENV(state, env){
@@ -31,11 +31,11 @@ export default {
 		}
 	},
 	actions: {},
-	getter: {
+	getters: {
 		isLogin(state){
-			if(state.token){
+			if(state.accessToken) {
 				return true;
-			}else{
+			} else {
 				return false
 			}
 		}

+ 0 - 1
utils/preCheck.js

@@ -43,7 +43,6 @@ if (platform() === 'H5') {
     //   uni.setStorageSync('stationType', station)
     // }
   // }
-  console.log(openIdSt,'openIdSt');
   if (!openIdSt) {
     const code = getWxQuery('code')
     console.log(code,'code');