Browse Source

2023-3-23

cmy 2 years ago
parent
commit
55dfcf3ed1
52 changed files with 1635 additions and 55 deletions
  1. 3 0
      .gitignore
  2. 1 1
      androidPrivacy.json
  3. 11 0
      api/rent.js
  4. 37 0
      api/wx.js
  5. 1 1
      components/pageFooter/index.vue
  6. 2 2
      config/app.js
  7. 25 4
      manifest.json
  8. 26 1
      pages.json
  9. 3 3
      pages/index/diy/components/headerSerch.vue
  10. 7 8
      pages/index/diy/components/tabNav.vue
  11. 14 9
      pages/index/index.vue
  12. 916 0
      pages/index/newindex/index.vue
  13. 8 0
      pages/mall/carDetail.vue
  14. 241 0
      pages/mall/index.vue
  15. 1 1
      static/html/pc.html
  16. BIN
      static/images/controller_baoxiu.png
  17. BIN
      static/images/controller_dianchi.png
  18. BIN
      static/images/controller_dingwei.png
  19. BIN
      static/images/controller_huanche.png
  20. BIN
      static/images/controller_kaisuo.png
  21. BIN
      static/images/controller_qidong.png
  22. BIN
      static/images/controller_shouquan.png
  23. BIN
      static/images/controller_witchMessage.png
  24. BIN
      static/images/controller_witchShop.png
  25. BIN
      static/images/controller_xincheng.png
  26. BIN
      static/images/controller_xunche.png
  27. BIN
      static/images/goodsExit.png
  28. BIN
      static/images/homeLeftIcon.png
  29. BIN
      static/images/hometext.png
  30. 5 5
      store/getters.js
  31. 3 3
      store/index.js
  32. 17 17
      uni.scss
  33. BIN
      unpackage/res/icons/1024x1024.png
  34. BIN
      unpackage/res/icons/120x120.png
  35. BIN
      unpackage/res/icons/144x144.png
  36. BIN
      unpackage/res/icons/152x152.png
  37. BIN
      unpackage/res/icons/167x167.png
  38. BIN
      unpackage/res/icons/180x180.png
  39. BIN
      unpackage/res/icons/192x192.png
  40. BIN
      unpackage/res/icons/20x20.png
  41. BIN
      unpackage/res/icons/29x29.png
  42. BIN
      unpackage/res/icons/40x40.png
  43. BIN
      unpackage/res/icons/58x58.png
  44. BIN
      unpackage/res/icons/60x60.png
  45. BIN
      unpackage/res/icons/72x72.png
  46. BIN
      unpackage/res/icons/76x76.png
  47. BIN
      unpackage/res/icons/80x80.png
  48. BIN
      unpackage/res/icons/87x87.png
  49. BIN
      unpackage/res/icons/96x96.png
  50. 39 0
      utils/log.js
  51. 24 0
      utils/platform.js
  52. 251 0
      utils/wxAuthorized.js

+ 3 - 0
.gitignore

@@ -0,0 +1,3 @@
+.DS_Store
+unpackage/dist
+.hbuilderx

+ 1 - 1
androidPrivacy.json

@@ -2,7 +2,7 @@
     "version" : "1",
     "prompt" : "template",
     "title" : "用户协议与隐私政策",
-    "message" : "\t请务必审慎阅读、充分理解“用户协议与 隐私政策”各条款,包括但不限于:为了 向你提供即时通讯、内容分享等服务,我 们需要收集你的设备信息、操作日志等个 人信息。你可以在“设置”中查看、变更、删除个人信息并管理你的授权。<br/>
+    "message" : "\t请务必审慎阅读、充分理解“用户协议与 隐私政策”各条款,包括但不限于:为了 向你提供即时通讯、内容分享等服务,我 们需要收集你的设备信息、操作日志等个 人信息。你可以在“设置”中查看、变更、删除个人信息并管理你的授权。<br/>\r
  你可以阅读 <a href=\"pages/columnGoods/static/yhxy.html\">《用户协议》</a>与 <a href=\"pages/columnGoods/static/yszc.html\">《隐私政策》</a>了解详细信息。如你同意,请点击“我同意”开始接受我们的服务。",
     "buttonAccept" : "同意并接受",
     "buttonRefuse" : "暂不同意",

+ 11 - 0
api/rent.js

@@ -0,0 +1,11 @@
+import request from "@/utils/request.js";
+
+/**
+ * 获取车辆列表
+ * @param data object 用户账号密码
+ */
+export function getCarList(data) {
+	return request.get(
+		"v3/rent", data
+	);
+}

+ 37 - 0
api/wx.js

@@ -0,0 +1,37 @@
+import request from '@/utils/request'
+// 微信分享信息
+export function share(data) {
+	return request({
+		url: '/api/share',
+		method: 'get',
+		data
+	});
+}
+// #ifdef H5
+//微信配置
+export function wechatConfig(data) {
+	return request({
+		url: '/api/wechat/config',
+		method: 'get',
+		data
+	});
+}
+// 微信code地址
+export function wechatAuth(data) {
+	return request({
+		url: '/api/wechat/auth',
+		method: 'get',
+		data
+	});
+}
+// #endif
+// #ifdef MP-WEIXIN
+// 微信code地址
+export function wechatMpAuth(data) {
+	return request({
+		url: '/api/wechat/mp_auth',
+		method: 'post',
+		data
+	});
+}
+// #endif

+ 1 - 1
components/pageFooter/index.vue

@@ -140,7 +140,7 @@
 		height: calc(98rpx+ constant(safe-area-inset-bottom)); ///兼容 IOS<11.2/
 		height: calc(98rpx + env(safe-area-inset-bottom)); ///兼容 IOS>11.2/
 		box-sizing: border-box;
-		border-top: solid 1rpx #F3F3F3;
+		// border-top: solid 1rpx #F3F3F3;
 		backdrop-filter: blur(10px);
 		background-color: #fff;
 		box-shadow: 0px 0px 17rpx 1rpx rgba(206, 206, 206, 0.32);

+ 2 - 2
config/app.js

@@ -2,13 +2,13 @@ module.exports = {
 	// 小程序配置
 	// #ifdef MP || APP-PLUS
 	// 请求域名 格式: https://您的域名
-	HTTP_REQUEST_URL: `https://demo.crmeb.com`,
+	HTTP_REQUEST_URL: `http://yc.frp.liuniu946.com`,
 	// #endif
 
 	// H5配置
 	// #ifdef H5
 	//H5接口是浏览器地址,非单独部署不用修改
-	HTTP_REQUEST_URL: window.location.protocol + "//" + window.location.host,
+	HTTP_REQUEST_URL: window.location.protocol + "//" + window.location.host+'/frp',
 	// #endif 
 
 	// 以下配置在不做二开的前提下,不需要做任何的修改

+ 25 - 4
manifest.json

@@ -1,7 +1,7 @@
 {
-    "name" : "CRMEB标准版",
-    "appid" : "__UNI__A3F1ED4",
-    "description" : "CRMEB标准版",
+    "name" : "壹柒科技",
+    "appid" : "__UNI__9417D5E",
+    "description" : "壹柒科技",
     "versionName" : "4.6.0",
     "versionCode" : 461,
     "transformPx" : false,
@@ -100,7 +100,18 @@
                         "UniversalLinks" : "https://bzapp.crmeb.net/uni-universallinks/__UNI__A3F1ED4/"
                     }
                 },
-                "push" : {},
+                "push" : {
+                    "unipush" : {
+                        "version" : "2",
+                        "offline" : true,
+                        "hms" : {},
+                        "oppo" : {},
+                        "vivo" : {},
+                        "mi" : {},
+                        "meizu" : {},
+                        "fcm" : {}
+                    }
+                },
                 "maps" : {
                     "amap" : {
                         "appkey_ios" : "aeb768547b9d752891e37e1ca0a2b66d",
@@ -207,6 +218,16 @@
     },
     "h5" : {
         "devServer" : {
+            "proxy" : {
+                "^/frp" : {
+                    "target" : "http://yc.frp.liuniu946.com",
+                    // "target": "http://heyu.frp.liuniu946.com",
+                    "changeOrigin" : true,
+                    "pathRewrite" : {
+                        "/frp" : "" // rewrite path
+                    }
+                }
+            },
             "https" : false
         },
         "router" : {

+ 26 - 1
pages.json

@@ -60,8 +60,33 @@
 				}
 
 			}
+		},
+		{
+			"path": "pages/mall/index",
+			"style": {
+				"navigationBarTitleText": "商城",
+				"app-plus": {
+					// #ifdef APP-PLUS
+					"titleNView": {
+						"type": "default"
+					}
+					// #endif
+				}
+			}
+		},
+		{
+			"path": "pages/mall/carDetail",
+			"style": {
+				"navigationBarTitleText": "商品详情",
+				"app-plus": {
+					// #ifdef APP-PLUS
+					"titleNView": {
+						"type": "default"
+					}
+					// #endif
+				}
+			}
 		}
-
 	],
 	"subPackages": [{  // 模块分包
 			"root": "pages/extension",

+ 3 - 3
pages/index/diy/components/headerSerch.vue

@@ -119,9 +119,9 @@
 				flex: 1;
 				height: 58rpx;
 				padding: 0 0 0 30rpx;
-				background: rgba(247, 247, 247, 1);
-				border: 1px solid rgba(241, 241, 241, 1);
-				color: #BBBBBB;
+				background: rgba(47, 49, 66, 1);
+				// border: 1px solid rgba(241, 241, 241, 1);
+				color: #FFFFFF;
 				font-size: 28rpx;
 
 				.iconfont {

+ 7 - 8
pages/index/diy/components/tabNav.vue

@@ -14,9 +14,9 @@
 						v-for="(item,index) in tabTitle" :key="index" :id="'id'+index" @click="longClick(item,index)">
 						{{$t(item.cate_name)}}
 					</view>
-					<view class="underlineBox" :style='"transform:translateX("+isLeft+"px);width:"+isWidth+"px"'>
+					<!-- <view class="underlineBox" :style='"transform:translateX("+isLeft+"px);width:"+isWidth+"px"'>
 						<view class="underline"></view>
-					</view>
+					</view> -->
 				</scroll-view>
 			</view>
 		</view>
@@ -78,10 +78,10 @@
 			getAllCategory: function() {
 				let that = this;
 				getCategoryList().then(res => {
-					res.data.unshift({
-						"id": -99,
-						'cate_name': '首页'
-					})
+					// res.data.unshift({
+					// 	"id": -99,
+					// 	'cate_name': '首页'
+					// })
 					that.tabTitle = res.data;
 					setTimeout((e) => {
 						const query = uni.createSelectorQuery().in(this);
@@ -108,8 +108,7 @@
 		width: 100%;
 		background: linear-gradient(90deg, $bg-star 50%, $bg-end 100%);
 		color: rgba(255, 255, 255, 1);
-		padding-bottom: 20rpx;
-
+		// padding-bottom: 20rpx;
 		&.isFixed {
 			z-index: 45;
 			position: fixed;

+ 14 - 9
pages/index/index.vue

@@ -1,11 +1,15 @@
 <template>
-	<diy ref="diy" v-if="isDiy"></diy>
-	<visualization v-else></visualization>
+	<div style="height: 100%;">
+		<!-- <diy ref="diy" v-if="isDiy"></diy>
+		<visualization v-else></visualization> -->
+		<index></index>
+	</div>
 </template>
 
 <script>
-	import diy from './diy'
-	import visualization from './visualization'
+	// import diy from './diy'
+	// import visualization from './visualization'
+	import index from './newindex/index.vue';
 	import Cache from '@/utils/cache';
 	import {
 		getShare
@@ -19,14 +23,15 @@
 			}
 		},
 		components: {
-			diy,
-			visualization
+			index
+			// diy,
+			// visualization
 		},
 		onShow() {
 			uni.hideTabBar()
-			uni.$on('is_diy', (data) => {
-				this.isDiy = data
-			})
+			// uni.$on('is_diy', (data) => {
+			// 	this.isDiy = data
+			// })
 			this.setOpenShare();
 		},
 		onHide() {

+ 916 - 0
pages/index/newindex/index.vue

@@ -0,0 +1,916 @@
+<template>
+	<view class="pageBox">
+		<view class="userOff" v-if="actionCartItem">
+			<view class="navBox">
+				<view class="flex topIconBox">
+					<image @click="navTo('/pages/index/shopTab?type=1')" class="topIcon"
+						src="../../../static/images/controller_witchShop.png" mode="widthFix"></image>
+					<view v-if="actionCartItem" class="clamp padding-l-10 padding-r-10">
+						{{actionCartItem.car_name||''}}
+					</view>
+					<image @click="navTo('/pages/index/notice')" class="topIcon"
+						src="../../../static/images/controller_witchMessage.png" mode="widthFix">
+					</image>
+					<view class="topIconNum flex" v-if="notify>0">
+						<text>
+							{{notify}}
+						</text>
+					</view>
+				</view>
+			</view>
+			<view class="actionBox">
+				<image class="cartImg" :src="actionCartItem.image" mode="aspectFit"></image>
+				<view class="timeBox" v-if="actionCartItem.day>0">
+					<view style="border-radius: 20rpx;"
+						class="rowContentBox flexCenter lineBorder padding-l-20 padding-r-20 padding-t-10 padding-b-10">
+						<view class="tipMen"></view>
+						<view class="dayBox" v-if="actionCartItem.car_operate">
+							<view>
+								{{actionCartItem.day}}
+							</view>
+							<view class="oldDay margin-t-10">
+								剩余天数
+							</view>
+						</view>
+						<view class="dayBox" v-else>
+							<view class="oldDay margin-t-10 font-color-red">
+								已欠费
+							</view>
+						</view>
+					</view>
+				</view>
+			</view>
+			<view class="content">
+				<view class="contentButtom flexCenter">
+					<view class="buttomBox flex">
+						<view class="leftBox">
+							<view class="buttom buttomLg ">
+								<view @click="authSet" class="rowContentBox flexCenter lineBorder">
+									<view class="tipMen"></view>
+									<view class="centerTextBox">
+										<view>
+											<image class="tipIcon" src="../../../static/images/controller_shouquan.png"
+												mode="aspectFit"></image>
+										</view>
+										<view class="margin-t-10">
+											授权
+										</view>
+									</view>
+								</view>
+								<view class="rightPaddingBg">
+								</view>
+								<view class="buttomPaddingBg">
+								</view>
+							</view>
+							<view class="leftCenterButtom buttom" @click="navTo('/pages/user/money/recharge')">
+								<view class="rowContentBox flexCenter lineBorder">
+									<view class="tipMen"></view>
+									<view>
+										<view>
+											充
+										</view>
+										<view>
+											值
+										</view>
+									</view>
+								</view>
+								<view class="topBageBg"></view>
+								<view class="bottomBageBg"></view>
+							</view>
+							<view class="buttomLg buttom">
+								<view @click="navTo('/pages/user/reportForRepair/Report?id='+actionCartItem.car_number)"
+									class="rowContentBox flexCenter lineBorder">
+									<view class="tipMen"></view>
+									<view class="centerTextBox">
+										<view>
+											<image class="tipIcon" src="../../../static/images/controller_baoxiu.png"
+												mode="aspectFit"></image>
+										</view>
+										<view class="margin-t-10">
+											报修
+										</view>
+									</view>
+								</view>
+								<view class="topPaddingBg"></view>
+								<view class="rightPaddingBg"></view>
+							</view>
+						</view>
+						<view class="centerBgBox">
+							<view class="centerBg lineBorder borderRadiusAll">
+								<view class="borTopHide"></view>
+								<view class="borBottomHide"></view>
+							</view>
+							<view class="bgGray borderRadiusAll"></view>
+							<view class="contentOrg borderRadiusAll">
+								<view class="contentOrgBg borderRadiusAll centerBox lineBorder2 flexCenter">
+									<view class="centerBoxJb borderRadiusAll lineBorder2">
+										<view class="boxBgJb borderRadiusAll flexCenter">
+											<view class="flex-center">
+												<view class="iconButtomBox borderRadiusAll flexCenter"
+													:class="{greedBg:actionCartItem.status==1||actionCartItem.status==3||actionCartItem.status==4}"
+													@click="tabCarStatus('tab',actionCartItem)">
+													<view class="mr borderRadiusAll "></view>
+													<view class="iconButtomJb">
+														<view>
+															<image class="img"
+																src="../../../static/images/controller_qidong.png"
+																mode="aspectFit"></image>
+														</view>
+														<view class="margin-t-10"
+															v-if="actionCartItem.status==1||actionCartItem.status==3||actionCartItem.status==4">
+															启动
+														</view>
+														<view class="margin-t-10" v-else>
+															关闭
+														</view>
+													</view>
+												</view>
+											</view>
+										</view>
+									</view>
+									<view class="line left"></view>
+									<view class="line right"></view>
+									<view @click="alertCartList" class="topButtomTipBox posbuttom flexCenter">
+										<view class="centerTextBox">
+											<view>
+												<image class="tipIcon"
+													src="../../../static/images/controller_huanche.png"
+													mode="aspectFit"></image>
+											</view>
+											<view class="margin-t-10">
+												换车
+											</view>
+										</view>
+									</view>
+									<view class="rightButtomTipBox posbuttom flexCenter"
+										@click="tabCarStatus('seek',actionCartItem)">
+										<view class="centerTextBox">
+											<view>
+												<image class="tipIcon"
+													src="../../../static/images/controller_xunche.png" mode="aspectFit">
+												</image>
+											</view>
+											<view class="margin-t-10">
+												寻车
+											</view>
+										</view>
+									</view>
+									<view
+										@click="openMap(actionCartItem.cartInfo.latitude,actionCartItem.cartInfo.longitude)"
+										class="bottomButtomTipBox posbuttom flexCenter">
+										<view class="centerTextBox">
+											<view>
+												<image class="tipIcon"
+													src="../../../static/images/controller_dingwei.png"
+													mode="aspectFit"></image>
+											</view>
+											<view class="margin-t-10">
+												定位
+											</view>
+										</view>
+									</view>
+									<view class="leftButtomTipBox posbuttom flexCenter"
+										@click="tabCarStatus('unlock',actionCartItem)">
+										<view class="centerTextBox">
+											<view>
+												<image class="tipIcon"
+													src="../../../static/images/controller_kaisuo.png" mode="aspectFit">
+												</image>
+											</view>
+											<view class="margin-t-10">
+												开座垫
+											</view>
+										</view>
+									</view>
+								</view>
+							</view>
+						</view>
+						<view class="rightBox">
+							<view class="rightButtom buttom flex">
+
+								<view class="centerTextBox">
+									<view>
+										{{actionCartItem.bfb||0}}%
+									</view>
+									<view>
+										<image class="tipIcon" src="../../../static/images/controller_dianchi.png"
+											mode="aspectFit"></image>
+									</view>
+								</view>
+								<view class="rightElectric flexCenter">
+									<view class="electric" :class="{greedBg:actionCartItem.bfb>91}"></view>
+									<view class="electric" :class="{greedBg:actionCartItem.bfb>83}"></view>
+									<view class="electric" :class="{greedBg:actionCartItem.bfb>75}"></view>
+									<view class="electric" :class="{greedBg:actionCartItem.bfb>66}"></view>
+									<view class="electric" :class="{yellowBg:actionCartItem.bfb>58}"></view>
+									<view class="electric" :class="{yellowBg:actionCartItem.bfb>50}"></view>
+									<view class="electric" :class="{yellowBg:actionCartItem.bfb>41}"></view>
+									<view class="electric" :class="{yellowBg:actionCartItem.bfb>33}"></view>
+									<view class="electric" :class="{redGb:actionCartItem.bfb>24}"></view>
+									<view class="electric" :class="{redGb:actionCartItem.bfb>16}"></view>
+									<view class="electric" :class="{redGb:actionCartItem.bfb>8}"></view>
+									<view class="electric" :class="{redGb:actionCartItem.bfb>0}"></view>
+								</view>
+							</view>
+							<view class=" buttomLg buttom"
+								@click="navTo('/pages/index/route?id='+actionCartItem.car_number)">
+								<view class="topBageBg"></view>
+								<view class="rowContentBox flexCenter lineBorder">
+									<view class="tipMen"></view>
+									<view class="centerTextBox margin-l-40 padding-l-30">
+										<view>
+											<image class="tipIcon" src="../../../static/images/controller_xincheng.png"
+												mode="aspectFit"></image>
+										</view>
+										<view class="margin-t-10">
+											行程
+										</view>
+									</view>
+								</view>
+								<view class="topPaddingBg"></view>
+								<view class="leftPaddingBg"></view>
+							</view>
+						</view>
+					</view>
+				</view>
+			</view>
+		</view>
+		<uni-popup ref="popup" type="bottom" v-if="actionCartItem">
+			<view class="cartListAlertButtom">
+				<view class="cartTitle flex">
+					<view>
+						请选择更换的车辆
+					</view>
+					<image @click="popupClose" class="exit" src="../../../static/images/goodsExit.png"
+						mode="scaleToFill">
+					</image>
+				</view>
+				<view class="actionCartBox">
+					<view class="itemCart flex" :class="{action:item.id==actionCartItem.id}"
+						v-for="(item,index) in myCartList" @click="changeCart(index)" :key='index'>
+						<image class="cartImg" :src="item.image" mode="scaleToFill"></image>
+						<view class="content">
+							<view class="title clamp2" :class="{action:item.id==actionCartItem.id}">
+								{{item.car_name||''}}
+							</view>
+							<view class="address margin-t-20" :class="{action:item.id==actionCartItem.id}">
+								{{item.address||"暂无定位信息"}}
+							</view>
+						</view>
+					</view>
+				</view>
+				<view style="height: 1px;"></view>
+			</view>
+		</uni-popup>
+		<pageFoot></pageFoot>
+	</view>
+</template>
+<script>
+	import {
+		mycar,
+		getCarInfo,
+		getcar_status,
+		car_switch,
+		getUserInfo
+	} from '@/api/user.js';
+	import {
+		mapGetters
+	} from 'vuex';
+	import pageFoot from '@/components/pageFooter/index.vue';
+	export default {
+		props: {
+			notify: {
+				type: Number,
+				default: 0
+			},
+		},
+		components: {
+			pageFoot
+		},
+		data() {
+			return {
+				chickedMyCart: 0, //默认选中的车辆
+				// 我的车辆
+				myCartList: [],
+				ladingCart: false, //判断是否已经加载过我的车辆
+				// #ifdef H5
+				iconPath: '../../static/image/location.png', //定位图标地址
+				// #endif
+				// #ifndef H5
+				iconPath: '../../../static/image/location.png', //定位图标地址
+				// #endif
+				timeOut: '', //用于存放调用定时获取对象数据
+				reachangeAlert: false, //判断是否已经提示过充值
+			};
+		},
+		watch: {
+			reachange(newValue, oldValue) {
+				if (newValue && (this.actionCartItem.auth_num != -1)) {
+					uni.showModal({
+						title: '错误',
+						content: '您的余额已不足三天支付是否马上充值',
+						cancelText: '关闭',
+						confirmText: '马上充值',
+						success: res => {
+							if (res.confirm) {
+								this.navTo('/pages/user/money/recharge');
+							}
+						},
+					});
+				}
+
+			}
+		},
+		computed: {
+			...mapGetters(['userInfo']),
+			actionCartItem() {
+				if (this.myCartList[this.chickedMyCart]) {
+					return this.myCartList[this.chickedMyCart]
+				} else {
+					return false
+				}
+			},
+			reachange() {
+				// 余额
+				const a1 = +this.userInfo.now_money;
+				if (!this.actionCartItem) {
+					return false
+				}
+				// 三天内应该付的金额
+				const a2 = this.actionCartItem.day_deducted * 3;
+				if (a1 < a2 && !this.reachangeAlert && this.actionCartItem.day > 0) {
+					// 处理已加载提示用户充值信息
+					this.reachangeAlert = true;
+					return (new Date()).getTime()
+				} else {
+					return false
+				}
+			}
+		},
+		created() {
+			// this.getUserInfo();
+		},
+	};
+</script>
+
+<style lang="scss">
+	$paddingJg:40rpx;
+	// 按钮黑色背景
+	$bgBlack:#161727;
+	// 底色
+	$contentBg:#373c5a;
+	// 按钮包裹框背景颜色
+	$maxBoxBg:#1f2136;
+
+	.pageBox {
+		height: 0;
+		min-height: 100%;
+	}
+
+	.flexCenter {
+		display: flex;
+		justify-content: center;
+		align-items: center;
+	}
+
+	.navBox {
+		/* #ifdef APP */
+		padding-top: var(--status-bar-height);
+		padding-bottom: 30rpx;
+		/* #endif */
+		/* #ifdef H5 || MP */
+		padding-top: 30rpx;
+		padding-bottom: 30rpx;
+		/* #endif */
+		background-color: $contentBg;
+		flex-shrink: 0;
+	}
+
+	.topIconBox {
+		padding: 0 $paddingJg;
+		position: relative;
+		color: #FFFFFF;
+		font-size: $uni-font-size-base + 2rpx;
+
+		.topIconNum {
+			position: absolute;
+			top: -10rpx;
+			right: 20rpx;
+			font-size: $uni-font-size-sm;
+			min-width: 30rpx;
+			min-height: 30rpx;
+			border-radius: 100rpx;
+			background-color: $uni-color-error;
+			padding: 5rpx;
+			justify-content: center;
+		}
+
+		.topIcon {
+			transform: rotateZ(-90deg);
+			width: 45rpx;
+			height: 45rpx;
+			flex-shrink: 0;
+		}
+	}
+
+	.userOff {
+		display: flex;
+		flex-direction: column;
+		height: 100%;
+
+		.actionBox {
+			background-color: #0f1025;
+			flex-shrink: 1;
+			flex-grow: 1;
+			text-align: center;
+			height: 400rpx;
+			position: relative;
+
+			.cartImg {
+				height: 100%;
+				width: 100%;
+			}
+
+			.timeBox {
+				position: absolute;
+				color: #FFFFFF;
+				right: 30rpx;
+				top: 30rpx;
+				font-size: $uni-font-size-base;
+				font-weight: bold;
+
+				.dayBox {
+					z-index: 1;
+					line-height: 1;
+				}
+
+				.oldDay {
+					font-size: $uni-font-size-sm - 2rpx;
+					color: $uni-border-color;
+				}
+
+				.tipMen {
+					transform-origin: top left;
+					margin-left: 0;
+				}
+			}
+		}
+
+		.content {
+			flex-shrink: 0;
+			flex-grow: 1;
+		}
+
+		.lineBorder {
+			border: 1px solid #aaaec7;
+		}
+
+		.lineBorder2 {
+			border: 1px solid #b7cbf2;
+		}
+
+		.rowContentBox {
+			overflow: hidden;
+			background-color: $contentBg;
+
+			.tipMen {
+				position: absolute;
+				top: 0;
+				left: 0;
+				transform-origin: top left;
+				margin-left: -40rpx;
+				transform: rotateZ(-45deg);
+				height: 100%;
+				width: 100%;
+				background-image: linear-gradient(to bottom, rgba(69, 75, 113, 1) 0%, transparent 100%);
+			}
+		}
+
+		.rowContentBox,
+		.centerBox {
+			height: 100%;
+			width: 100%;
+			position: relative;
+		}
+
+		.contentButtom {
+
+			width: 750rpx;
+			height: 100%;
+			background-color: $maxBoxBg;
+			font-size: $uni-font-size-base;
+			line-height: 1;
+
+			.centerTextBox {
+				text-align: center;
+				margin-left: -70rpx;
+			}
+
+			.tipIcon {
+				width: 46rpx;
+				height: 46rpx;
+			}
+
+			.buttomBox {
+				width: 750rpx;
+				padding: 40rpx;
+				color: #B2B9D3;
+
+				.buttom {
+					padding: 10rpx;
+					background-color: $bgBlack;
+					position: relative;
+
+					.rightPaddingBg,
+					.topPaddingBg,
+					.leftPaddingBg,
+					.buttomPaddingBg {
+						position: absolute;
+						background-color: $bgBlack;
+						z-index: 11;
+					}
+
+					.topPaddingBg,
+					.buttomPaddingBg {
+						height: 12rpx;
+						width: 180rpx;
+						left: 0;
+					}
+
+					.rightPaddingBg,
+					.leftPaddingBg {
+						height: 180rpx;
+						width: 10rpx;
+						top: 0rpx;
+					}
+
+					.topPaddingBg {
+						top: -1px;
+					}
+
+					.buttomPaddingBg {
+						button: 0rpx;
+					}
+
+					.rightPaddingBg {
+						right: 0rpx;
+					}
+
+					.leftPaddingBg {
+						left: 0;
+					}
+
+					.topBageBg,
+					.bottomBageBg {
+						height: 30rpx;
+						width: 180rpx;
+						background-color: $maxBoxBg;
+						position: absolute;
+						z-index: 10;
+					}
+
+					.topBageBg {
+						top: -30rpx;
+					}
+
+					.bottomBageBg {
+						bottom: -30rpx;
+					}
+				}
+
+				.centerBox {
+					// background-image: linear-gradient(to bottom, #49548d 0%, transparent 100%);
+					background-color: rgba($color: #49548d, $alpha: 0.5);
+					box-shadow: 0px 0px 30rpx rgba($color: #5a6fdb, $alpha: 0.5) inset;
+				}
+
+
+				.buttomLg {
+					width: 180rpx;
+					height: 180rpx;
+				}
+
+
+				.leftBox {
+					.leftCenterButtom {
+						margin: 30rpx 0;
+						width: 80rpx;
+						height: 120rpx;
+						background-size: 80rpx 120rpx;
+						z-index: 99;
+
+						.tipMen {
+							margin-left: 0rpx;
+						}
+					}
+				}
+
+				.centerBgBox {
+					flex-shrink: 1;
+					position: relative;
+
+					.borderRadiusAll {
+						border-radius: 1000rpx;
+					}
+
+					.bgGray {
+						position: absolute;
+						top: 0;
+						left: 0;
+						background-color: $maxBoxBg;
+						width: 530rpx;
+						height: 530rpx;
+						z-index: 20;
+						left: -265rpx;
+						top: -265rpx;
+					}
+
+					.contentOrg {
+						position: absolute;
+						background-color: $bgBlack;
+						width: 480rpx;
+						height: 480rpx;
+						left: -240rpx;
+						top: -240rpx;
+						z-index: 99;
+						padding: 20rpx;
+
+						.contentOrgBg {
+							width: 100%;
+							height: 100%;
+							position: relative;
+							background-color: $contentBg;
+							background-image: linear-gradient(to bottom, rgba($color: #454b71, $alpha: 1) 0%, transparent 25%, transparent 75%, rgba($color: #454b71, $alpha: 1) 100%);
+
+							.posbuttom {
+								position: absolute;
+
+								.centerTextBox {
+									margin: 0;
+								}
+							}
+
+							.topButtomTipBox {
+								top: 0;
+								padding-bottom: 20rpx;
+							}
+
+							.bottomButtomTipBox {
+								bottom: 0;
+								padding-top: 20rpx;
+							}
+
+							.bottomButtomTipBox,
+							.topButtomTipBox {
+								width: 200rpx;
+								height: 140rpx;
+								margin: 0 auto;
+							}
+
+							.rightButtomTipBox,
+							.leftButtomTipBox {
+								width: 140rpx;
+								height: 200rpx;
+							}
+
+							.rightButtomTipBox {
+								padding-left: 20rpx;
+								right: 0;
+							}
+
+							.leftButtomTipBox {
+								padding-right: 20rpx;
+								left: 0;
+							}
+
+							.line {
+								position: absolute;
+								width: calc(440rpx + 2px);
+								height: 20rpx;
+								border-top: 1px solid #b7cbf2;
+								border-bottom: 1px solid #b7cbf2;
+								border-left: 1px solid $bgBlack;
+								border-right: 1px solid $bgBlack;
+								background-color: $bgBlack;
+								box-shadow: 0px 0px 30rpx rgba($color: #5a6fdb, $alpha: 0.5);
+
+								&.left {
+									transform: rotateZ(45deg);
+								}
+
+								&.right {
+									transform: rotateZ(-45deg);
+
+								}
+							}
+
+							.centerBoxJb {
+								width: 200rpx;
+								height: 200rpx;
+								background-color: $bgBlack;
+								box-shadow: 0px 0px 30rpx rgba($color: #5a6fdb, $alpha: 0.5);
+								position: relative;
+
+								.boxBgJb {
+									background-color: $bgBlack;
+									width: 100%;
+									height: 100%;
+									position: absolute;
+									z-index: 1;
+
+									.iconButtomBox {
+										font-size: $uni-font-size-base;
+										color: #FFFFFF;
+										font-weight: bold;
+										width: 160rpx;
+										height: 160rpx;
+										background-color: #DEDEDE;
+										text-align: center;
+										background-color: #F6C531;
+										position: relative;
+
+										&.greedBg {
+											background-color: $uni-color-success;
+										}
+
+										.mr {
+											position: absolute;
+											height: 100%;
+											width: 100%;
+											background-image: linear-gradient(to bottom, rgba($color: #FFFFFF, $alpha: 0.2) 0%, rgba($color: #FFFFFF, $alpha: 0) 50%, rgba($color: #FFFFFF, $alpha: 0) 100%);
+											box-shadow: 0px 0px 20rpx rgba($color: #FFFFFF, $alpha: 0.5) inset;
+										}
+
+										.iconButtomJb {
+											.img {
+												width: 75rpx;
+												height: 75rpx;
+
+											}
+										}
+									}
+								}
+							}
+						}
+					}
+
+					.centerBg {
+						position: absolute;
+						left: -280rpx;
+						top: -280rpx;
+						background-color: $bgBlack;
+						width: 560rpx;
+						height: 560rpx;
+						z-index: 10;
+
+						.borTopHide {
+							top: -10rpx;
+							left: 120rpx;
+						}
+
+						.borBottomHide,
+						.borTopHide {
+							position: absolute;
+							height: 100rpx;
+							width: 316rpx;
+							background-color: $maxBoxBg;
+						}
+
+
+						.borBottomHide {
+							left: 120rpx;
+							bottom: -10rpx;
+						}
+					}
+				}
+
+				.rightBox {
+					flex-shrink: 0;
+
+					.rightElectric {
+						flex-direction: column;
+						padding-right: 6rpx;
+
+						.electric {
+							width: 40rpx;
+							height: 10rpx;
+							// border-radius: 10rpx;
+							background-color: $maxBoxBg;
+							margin-bottom: 16rpx;
+
+							// &:last-child{
+							// 	border-bottom-left-radius: 10rpx;
+							// 	border-bottom-right-radius: 10rpx;
+							// }
+							// &:first-child{
+							// 	border-top-left-radius: 10rpx;
+							// 	border-top-right-radius: 10rpx;
+							// }
+							&.greedBg {
+								background-color: $uni-color-success;
+							}
+
+							&.yellowBg {
+								background-color: #F6C531;
+							}
+
+							&.redGb {
+								background-color: #DE2C2C;
+							}
+						}
+					}
+
+					.rightButtom {
+						position: relative;
+						z-index: 11;
+						margin-bottom: 30rpx;
+						width: 180rpx;
+						height: 330rpx;
+						padding-left: 30rpx;
+						padding-top: 16rpx;
+						align-items: flex-start;
+
+						.centerTextBox {
+							text-align: right;
+							margin-left: 16rpx;
+
+						}
+					}
+				}
+
+			}
+		}
+	}
+
+	.cartListAlertButtom {
+		position: relative;
+		padding-top: 20rpx;
+		border-top-left-radius: 30rpx;
+		border-top-right-radius: 30rpx;
+		background-color: #FFFFFF;
+		z-index: 999;
+		/* #ifdef H5 */
+		padding-bottom: var(--window-bottom);
+
+		/* #endif */
+		.actionCartBox {
+			padding-bottom: 40rpx;
+
+			.itemCart {
+				background-color: #F3F6F8;
+				margin: 0 30rpx 30rpx;
+				padding: 0 30rpx;
+				border-radius: 20rpx;
+				height: 200rpx;
+				text-align: left;
+
+				&.action {
+					background-color: $uni-color-success;
+				}
+
+				.cartImg {
+					width: 120rpx;
+					height: 120rpx;
+				}
+
+				.content {
+					flex-grow: 1;
+					padding-left: 20rpx;
+				}
+
+				.title {
+					font-size: $uni-font-size-base;
+					font-weight: bold;
+					color: $uni-color-title;
+
+					&.action {
+						color: #FFFFFF;
+					}
+				}
+
+				.address {
+					line-height: 1;
+					font-size: $uni-font-size-sm - 2rpx;
+					color: $uni-border-color;
+
+					&.action {
+						color: #FFFFFF;
+					}
+				}
+			}
+		}
+
+		.cartTitle {
+			margin: 0 30rpx;
+			margin-bottom: 30rpx;
+			font-size: $uni-font-size-lg;
+			font-weight: bold;
+
+			.exit {
+				width: 50rpx;
+				height: 50rpx;
+			}
+		}
+
+	}
+</style>

+ 8 - 0
pages/mall/carDetail.vue

@@ -0,0 +1,8 @@
+<template>
+</template>
+
+<script>
+</script>
+
+<style>
+</style>

+ 241 - 0
pages/mall/index.vue

@@ -0,0 +1,241 @@
+<template>
+	<view class="bg">
+		<headerSerch v-if="headerData" :dataConfig="headerData"></headerSerch>
+		<view class="navTitle">
+			<view class="left_tab" @click="navTabIndex==0">租车</view>
+			<view class="right_tab">
+				<tabNav v-if="tabNavData" :dataConfig="tabNavData" @bindSortId="bindSortId"></tabNav>
+			</view>
+		</view>
+		<view v-if="navTabIndex==0">
+			<swiperBg v-if="swiperBgData" :dataConfig="swiperBgData"></swiperBg>
+		</view>
+		<view v-if="navTabIndex==1">
+
+		</view>
+		<view class="acea-row item row-between row-middle">
+			<view class="acea-row left">
+				<image class="icon" src="../../static/images/homeLeftIcon.png" mode="scaleToFill"></image>
+				<view>
+					火热租车
+				</view>
+			</view>
+			<!-- <view class="right">
+				更多>
+			</view> -->
+		</view>
+		<view class="list acea-row row-between ">
+			<view class="ls" v-for="(item,ind) in carList" :key='ind'>
+				<image class="img" :src="item.image" mode="scaleToFill"></image>
+				<view class="content">
+
+					<view class="line1 title">
+						{{item.title}}
+					</view>
+					<view class="info line1">
+						{{item.info}}
+					</view>
+					<view class="acea-row row-middle">
+						<text class="price">
+							¥{{+item.price}}
+						</text>
+						<text class="tip">
+							/月
+						</text>
+					</view>
+				</view>
+			</view>
+		</view>
+		<pageFoot></pageFoot>
+	</view>
+</template>
+
+<script>
+	import pageFoot from '@/components/pageFooter/index.vue';
+	import headerSerch from '../index/diy/components/headerSerch.vue';
+	import swiperBg from '../index/diy/components/swiperBg';
+	import tabNav from '../index/diy/components/tabNav';
+	import {
+		getDiy
+	} from '@/api/api.js';
+	import {
+		getCarList
+	} from '@/api/rent.js';
+	export default {
+		data() {
+			return {
+				headerData: '', //搜索栏设置数据
+				tabNavData: '', //分类设置数据
+				swiperBgData: '', //轮播图设置数据
+				navTabIndex: 0, //0租车1为商品
+				carList: [],
+				page: 1,
+				limit: 10,
+				loading: 'more', //加载状态more/loding/nomore
+			}
+		},
+		components: {
+			pageFoot,
+			headerSerch,
+			tabNav,
+			swiperBg
+		},
+		onShow() {
+			uni.hideTabBar()
+
+			this.getSearch();
+			this.getCarList();
+		},
+		onReachBottom() {
+			this.getCarList();
+		},
+		methods: {
+			bindSortId(data) {
+				console.log(data)
+			},
+			// 获取车辆列表
+			getCarList() {
+				const that = this;
+				if (that.loading == 'loding' || that.loading == 'nomore') {
+					return
+				}
+				that.loading = 'loding'
+				getCarList({
+					page: that.page,
+					limit: that.limit,
+				}).then((res) => {
+					that.carList = that.carList.concat(res.data.list);
+					that.page++
+					if (res.data.list.length == that.limit) {
+						that.loading = 'more'
+					} else {
+						that.loading = 'nomore'
+					}
+				}).catch((res) => {
+					console.log(res);
+					that.loading = 'more'
+				})
+			},
+			getSearch() {
+				const that = this;
+				getDiy(0).then(res => {
+					let lastArr = that.objToArr(res.data.value);
+					for (var i = 0; i < lastArr.length; i++) {
+						if (lastArr[i].name == 'headerSerch') {
+							that.headerData = lastArr[i]
+						}
+						if (lastArr[i].name == 'tabNav') {
+							that.tabNavData = lastArr[i]
+						}
+						if (lastArr[i].name == 'swiperBg') {
+							that.swiperBgData = lastArr[i]
+						}
+					}
+				})
+			},
+			// 对象转数组
+			objToArr(data) {
+				let obj = Object.keys(data);
+				let m = obj.map(key => data[key]);
+				return m;
+			},
+		},
+	}
+</script>
+
+<style lang="scss" scoped>
+	.navTitle {
+		display: flex;
+		align-items: center;
+		background-color: rgb(31, 33, 52);
+		line-height: 0;
+		padding-left: 30rpx;
+		padding-bottom: 20rpx;
+
+		.left_tab {
+			background-image: url('../../static/images/hometext.png');
+			background-size: 100%;
+			width: 120rpx;
+			text-align: center;
+			color: #75EFFA;
+			line-height: 1;
+			font-size: 34rpx;
+			font-weight: bold;
+			padding: 10rpx 0;
+		}
+
+		.right_tab {
+			width: 600rpx;
+		}
+	}
+
+	.bg {
+		background-color: rgb(31, 33, 52);
+	}
+
+	.item {
+		line-height: 1;
+		padding: 30rpx 20rpx;
+
+		.left {
+			font-size: $uni-font-size-lg;
+			color: #FFFFFF;
+
+			.icon {
+				width: 36rpx;
+				height: 36rpx;
+				margin-right: 10rpx;
+			}
+		}
+	
+	.right {
+			color: #999999;
+			font-size: $uni-font-size-sm;
+		}
+	}
+
+	.list {
+		padding: 0rpx 20rpx;
+		padding-bottom: 128rpx;
+
+		.ls {
+			width: 344rpx;
+			border-radius: 10rpx;
+			background-color: #161726;
+			color: #989898;
+			margin-bottom: 20rpx;
+
+			.content {
+				padding: 20rpx 10rpx;
+
+				.title {
+					font-size: $uni-font-size-base;
+					color: #FFFFFF;
+					font-weight: bold;
+				}
+
+				.info {
+					padding: 10rpx 0;
+				}
+
+				.price {
+					font-weight: bold;
+					color: #75EFFA;
+					font-size: 36rpx;
+				}
+
+				.tip {
+					color: #FFFFFF;
+					font-size: $uni-font-size-sm;
+				}
+			}
+
+			.img {
+				width: 344rpx;
+				height: 344rpx;
+				border-radius: 10rpx;
+				background-color: #FFFFFF;
+			}
+		}
+	}
+</style>

+ 1 - 1
static/html/pc.html

@@ -4,7 +4,7 @@
 		<meta charset="utf-8">
 		<meta http-equiv="X-UA-Compatible" content="IE=edge">
 		<meta name="viewport" content="width=device-width,user-scalable=no,initial-scale=1,maximum-scale=1,minimum-scale=1">
-		<title>crmeb-PC端</title>
+		<title>PC端</title>
 		<meta name="Copyright" content="helang">
 		<link rel="shortcut icon" type="image/png" href="">
 		<meta name="keywords" content="">

BIN
static/images/controller_baoxiu.png


BIN
static/images/controller_dianchi.png


BIN
static/images/controller_dingwei.png


BIN
static/images/controller_huanche.png


BIN
static/images/controller_kaisuo.png


BIN
static/images/controller_qidong.png


BIN
static/images/controller_shouquan.png


BIN
static/images/controller_witchMessage.png


BIN
static/images/controller_witchShop.png


BIN
static/images/controller_xincheng.png


BIN
static/images/controller_xunche.png


BIN
static/images/goodsExit.png


BIN
static/images/homeLeftIcon.png


BIN
static/images/hometext.png


+ 5 - 5
store/getters.js

@@ -9,11 +9,11 @@
 // +----------------------------------------------------------------------
 
 export default {
-  token: state => state.app.token,
-  isLogin: state => !!state.app.token,
-  backgroundColor: state => state.app.backgroundColor,
-  userInfo: state => state.app.userInfo || {},
-	uid:state => state.app.uid,
+	token: state => state.app.token,
+	isLogin: state => !!state.app.token,
+	backgroundColor: state => state.app.backgroundColor,
+	userInfo: state => state.app.userInfo || {},
+	uid: state => state.app.uid,
 	homeActive: state => state.app.homeActive,
 	home: state => state.app.home,
 	cartNum: state => state.indexData.cartNum,

+ 3 - 3
store/index.js

@@ -17,7 +17,7 @@ Vue.use(Vuex);
 const debug = process.env.NODE_ENV !== "production";
 
 export default new Vuex.Store({
-  modules,
-  getters,
-  strict: debug
+	modules,
+	getters,
+	strict: debug
 });

+ 17 - 17
uni.scss

@@ -47,41 +47,41 @@ $uni-border-color:#c8c7cc;
 /* 尺寸变量 */
 
 /* 文字尺寸 */
-$uni-font-size-sm:24upx;
-$uni-font-size-base:28upx;
-$uni-font-size-lg:32upx;
+$uni-font-size-sm:24rpx;
+$uni-font-size-base:28rpx;
+$uni-font-size-lg:32rpx;
 
 /* 图片尺寸 */
-$uni-img-size-sm:40upx;
-$uni-img-size-base:52upx;
-$uni-img-size-lg:80upx;
+$uni-img-size-sm:40rpx;
+$uni-img-size-base:52rpx;
+$uni-img-size-lg:80rpx;
 
 /* Border Radius */
-$uni-border-radius-sm: 4upx;
-$uni-border-radius-base: 6upx;
-$uni-border-radius-lg: 12upx;
+$uni-border-radius-sm: 4rpx;
+$uni-border-radius-base: 6rpx;
+$uni-border-radius-lg: 12rpx;
 $uni-border-radius-circle: 50%;
 $uni-border-radius-index: 12rpx; // 首页模块radius
 /* 水平间距 */
 $uni-spacing-row-sm: 10px;
-$uni-spacing-row-base: 20upx;
-$uni-spacing-row-lg: 30upx;
+$uni-spacing-row-base: 20rpx;
+$uni-spacing-row-lg: 30rpx;
 $uni-index-margin-col: 30rpx; // 模块水平magin
 /* 垂直间距 */
-$uni-spacing-col-sm: 8upx;
-$uni-spacing-col-base: 16upx;
-$uni-spacing-col-lg: 24upx;
+$uni-spacing-col-sm: 8rpx;
+$uni-spacing-col-base: 16rpx;
+$uni-spacing-col-lg: 24rpx;
 $uni-index-margin-row: 20rpx; // 模块垂直magin
 /* 透明度 */
 $uni-opacity-disabled: 0.3; // 组件禁用态的透明度
 $uni-index-box-shadow: 0rpx 3rpx 10rpx 2rpx rgba(0, 0, 0, 0.03);
 /* 文章场景相关 */
 $uni-color-title: #2C405A; // 文章标题颜色
-$uni-font-size-title:40upx;
+$uni-font-size-title:40rpx;
 $uni-color-subtitle: #555555; // 二级标题颜色
-$uni-font-size-subtitle:36upx;
+$uni-font-size-subtitle:36rpx;
 $uni-color-paragraph: #3F536E; // 文章段落颜色
-$uni-font-size-paragraph:30upx;
+$uni-font-size-paragraph:30rpx;
 $uni-color-tip: #ccc; // 底部提示文字颜色
 
 // 首页字号

BIN
unpackage/res/icons/1024x1024.png


BIN
unpackage/res/icons/120x120.png


BIN
unpackage/res/icons/144x144.png


BIN
unpackage/res/icons/152x152.png


BIN
unpackage/res/icons/167x167.png


BIN
unpackage/res/icons/180x180.png


BIN
unpackage/res/icons/192x192.png


BIN
unpackage/res/icons/20x20.png


BIN
unpackage/res/icons/29x29.png


BIN
unpackage/res/icons/40x40.png


BIN
unpackage/res/icons/58x58.png


BIN
unpackage/res/icons/60x60.png


BIN
unpackage/res/icons/72x72.png


BIN
unpackage/res/icons/76x76.png


BIN
unpackage/res/icons/80x80.png


BIN
unpackage/res/icons/87x87.png


BIN
unpackage/res/icons/96x96.png


+ 39 - 0
utils/log.js

@@ -0,0 +1,39 @@
+
+const logLength=100;//缓存存储上限
+const name = 'log';//缓存名字
+export function addLog (data,content='') {
+	let log = uni.getStorageSync(name)||[];
+	log.unshift({
+		title:data,
+		content:content
+	});
+	uni.setStorageSync(name,log);
+	initLog(log);
+}
+
+
+export function delLog () {
+	return uni.setStorageSync(name,'');
+}
+
+export function getLog () {
+	return uni.getStorageSync(name);
+}
+
+export function initLog (log) {
+	if(log.length>logLength){
+		const newarr = log.slice(log.length-logLength);
+		uni.setStorageSync(name,newarr);
+	}
+}
+export function showLog (log) {
+	
+	let str = '';
+	uni.getStorageSync(name).forEach((e) => {
+		str+=e.title+':'+JSON.stringify(e.content)
+	})
+	uni.showModal({
+		title:"日志",
+		content:str
+	})
+}

+ 24 - 0
utils/platform.js

@@ -0,0 +1,24 @@
+export function isAndroid() {  
+    var ua = navigator.userAgent,  
+            _isAndroid = ua.indexOf('Android') > -1 || ua.indexOf('Linux') > -1;  
+    return _isAndroid;  
+}  
+
+export function isIOS() {  
+    return !!navigator.userAgent.match(/(i[^;]+\;(U;)? CPU.+Mac OS X)/);  
+}  
+
+export function isPad() {  
+    return navigator.userAgent.toLowerCase().match(/iPad/i) == "ipad";  
+}  
+
+export function isWinPad() {  
+    return navigator.userAgent.indexOf("Windows NT") >= 0;  
+}  
+
+export default {
+	isAndroid,
+	isIOS,
+	isPad,
+	isWinPad
+}

+ 251 - 0
utils/wxAuthorized.js

@@ -0,0 +1,251 @@
+import {
+	wechatConfig,
+	share
+} from '@/api/wx';
+// 加载日志
+import * as log from './log.js'
+import {
+	isAndroid
+} from './platform.js'
+import store from '../store';
+// 保存wx对象
+import weixinObj from "@/plugin/jweixin-module/index.js";
+// 保存分享数据
+let shareData = '';
+// 保存注册返回appId数据
+let appId = '';
+//保存路由对象
+let router = '';
+//微信登录
+/**
+ * @param {string} 当前页面地址信息
+ */
+export async function loginWinxin() {
+	console.log('1');
+	let pages, page, path;
+	if (!router) {
+		router = await setRouter();
+	}
+	try {
+		pages = getCurrentPages();
+		// 获取跳转前页面
+		page = pages[pages.length - 1];
+		// 获取跳转前路由地址
+		path = page.route;
+	} catch (e) {
+		console.log(e);
+		//TODO handle the exception
+	}
+	// 判断是否在登录页
+	if (path != 'pages/public/redirect') {
+		log.addLog('开始注册微信')
+		weixindata().then(() => {
+			// 调用
+			try {
+				weixinSq();
+			} catch (e) {
+				console.log(e);
+				//TODO handle the exception
+			}
+		});
+	}
+};
+// 微信授权登录
+function weixinSq() {
+	// 微信授权后跳转页面
+	try {
+		// 判断是否真实路由模式
+		const type = router.mode === "history"?'':'/#'
+		let ul = encodeURIComponent(store.state.baseURL + store.state.urlFile +type+ '/pages/public/redirect');
+		// 打开微信授权页面
+		let url =
+			'https://open.weixin.qq.com/connect/oauth2/authorize?appid=' +
+			appId +
+			'&redirect_uri=' +
+			ul +
+			'&response_type=code&scope=snsapi_userinfo&state=' +
+			new Date().getTime() +
+			'#wechat_redirect';
+		window.location.href = url;
+	} catch (e) {
+		console.log(e);
+		//TODO handle the exception
+	}
+};
+
+// 微信注册
+export async function weixindata(config) {
+	let url;
+	try {
+		// 判断是否存在router
+		if (!router) {
+			router = await setRouter();
+		}
+		if (router.mode === "history") {
+			// 在ios中时候注册为微信刚进入时候的页面
+			if (!window.entryUrl) {
+				window.entryUrl = location.href.split('#')[0]
+			}
+			url = isAndroid() ? location.href.split('#')[0] : window.entryUrl;
+		}
+		if (router.mode === "hash") {
+			url = location.href.split('#')[0];
+		}
+		log.addLog('注册开始', url)
+		console.log('开始注册', url);
+
+	} catch (e) {
+		console.log('错误', e);
+	}
+	return new Promise((ok, error) => {
+		try {
+			//注册微信信息
+			wechatConfig({
+					url
+				})
+				.then(({
+					data
+				}) => {
+					try {
+						// 保存appId
+						appId = data.appId
+						// 微信信息配置
+						weixinObj.config({
+							debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
+							appId: data.appId, // 必填,企业号的唯一标识,此处填写企业号corpid
+							timestamp: data.timestamp, // 必填,生成签名的时间戳
+							nonceStr: data.nonceStr, // 必填,生成签名的随机串
+							signature: data.signature, // 必填,签名,见附录1
+							jsApiList: data.jsApiList // 必填,需要使用的JS接口列表,所有JS接口列表见附录2
+						});
+						weixinObj.ready((e) => {
+							log.addLog("注册完毕", data)
+							console.log('注册完毕');
+							ok(data,weixinObj)
+						})
+					} catch (e) {
+						console.log(e)
+					}
+				})
+				.catch(e => {
+					error(e);
+					console.log(e);
+				});
+		} catch (e) {
+			console.log(e);
+			//TODO handle the exception
+		}
+	})
+}
+
+// 判断分享调用方法
+export function shareLoad(config) {
+	console.log('开始调用分享')
+	try {
+		weixindata().then((e) => {
+			// 判断有无自定义数据
+			if (config) {
+				shareFun(config)
+			} else {
+				// 判断是否已经缓存了默认数据
+				if (shareData) {
+					shareFun()
+				} else {
+					// 请求获取默认数据
+					share({}).then(({
+						data
+					}) => {
+						shareData = data.data
+						shareFun()
+					});
+				}
+			}
+		})
+	} catch (e) {
+		console.log('报错', e)
+		//TODO handle the exception
+	}
+}
+// 配置分享数据
+function shareFun(config) {
+	try {
+		console.log('再付分享内容', config);
+		let mess;
+		if (config) {
+			mess = {
+				link: config.link, // 分享链接
+				imgUrl: config.imgUrl,
+				desc: config.desc,
+				title: config.title,
+				success: config.success || function(e) {
+					console.log(e);
+				},
+				fail: config.fail || function(e) {
+					console.log(e);
+				}
+			}
+		} else {
+			const userInfo = uni.getStorageSync('userInfo')
+			console.log(userInfo);
+			const url = window.location.href + '?spread=' + userInfo.uid;
+			url = url.replace(/[\?,&]{0,1}from=singlemessage/g, '');
+			mess = {
+				title: shareData.title,
+				link: url, // 分享链接
+				imgUrl: shareData.img, // 分享图标
+				desc: shareData.synopsis,
+				success: function() {
+					// uni.showModal({
+					// 	title: '分享',
+					// 	content: '分享成功',
+					// 	showCancel: false,
+					// 	success: res => {
+					//    console.log('分享成功回调接口');
+					// 	},
+					// 	fail: () => {},
+					// 	complete: () => {}
+					// });
+				}
+			}
+		}
+		// 获取仓库数据
+		// 分享好友
+		weixinObj.updateAppMessageShareData(mess);
+
+		// 分享朋友圈
+		weixinObj.updateTimelineShareData(mess)
+	} catch (e) {
+		console.log(e);
+		//TODO handle the exception
+	}
+}
+
+// 保存路由对象
+export function setRouter(route) {
+	return new Promise((ok, err) => {
+		router = getApp().$router;
+		console.log(router,'开始数据');
+		if (!router) {
+			const set = setInterval(() => {
+				router = getApp().$router;
+				console.log(router,'返回数据');
+				if (router) {
+					console.log(router,'结束');
+					clearInterval(set)
+					ok(router)
+				}
+			}, 100);
+		}else{
+			console.log(router,'成功');
+			ok(router)
+		}
+	})
+}
+
+export default {
+	weixinObj,
+	shareData,
+	appId,
+	setRouter,
+	shareLoad
+}