Browse Source

2024-4-24

cmy 10 months ago
parent
commit
f0833c8a9f

+ 41 - 54
api/game.js

@@ -1,115 +1,102 @@
 import request from '@/utils/request'
 
-// 互娱  游戏列表
-export  function getGameList(data) {
+// 挂出列表
+export  function getsell(data) {
 	return request({
-		url: `/api/game`,
+		url: `/api/sell`,
 		method: 'get',
 		data
 	});
 }
 
-// 互娱 获取当前游戏历史记录
-export function getGame(data,id) {
+// 挂出
+export  function sellPush(data) {
 	return request({
-		url: `/api/game/room/${id}`,
-		method: 'get',
+		url: `/api/sell`,
+		method: 'post',
 		data
 	});
 }
-
-// 互娱  游戏k线
-export  function gameKline(data,type) {
+// 买入订单
+export  function sellBuy(data) {
 	return request({
-		url: `/api/kline/${type}`,
-		method: 'get',
+		url: `/api/sell/buy/${data.id}`,
+		method: 'post',
 		data
 	});
 }
-// 互娱 获取钱包
-export  function gameWallet() {
+
+// 我的买入列表
+export  function sellBuyMy(data) {
 	return request({
-		url: `/api/wallet`,
+		url: `/api/sell/buy/my`,
 		method: 'get',
+		data
 	});
 }
-// 互娱  获取交易记录
-export  function gameBetList(data) {
+// 我的挂出列表
+export  function sellMy(data) {
 	return request({
-		url: `/api/game/bet/${data.id}`,
+		url: `/api/sell/my`,
 		method: 'get',
 		data
 	});
 }
 
-// 互娱  押注
-export  function gameBetIn(data) {
+
+
+// 实名认证
+export  function real_check(data) {
 	return request({
-		url: `/api/game/bet/${data.id}`,
+		url: `/api/user/real_check`,
 		method: 'post',
 		data
 	});
 }
-// 互娱  测试
-export  function gameTest() {
-	return request({
-		url: `/api/test`,
-		method: 'post',
-	});
-}
-// 充值
-export  function gamecharge(data) {
+
+// 余额列表
+export  function balanceList(data) {
 	return request({
-		url: `/api/charge`,
+		url: `/api/balance/list/USDT`,
 		method: 'get',
 		data
 	});
 }
 
-// 充值完成
-export  function gamechargePost(data) {
+// 转账
+export  function trade(data) {
 	return request({
-		url: `/api/charge`,
+		url: `/api/trade`,
 		method: 'post',
 		data
 	});
 }
-
-// 挂出列表
-export  function getsell(data) {
+// 提币
+export  function cash(data) {
 	return request({
-		url: `/api/sell`,
-		method: 'get',
+		url: `/api/extract/cash`,
+		method: 'post',
 		data
 	});
 }
-
-// 挂出
-export  function sellPush(data) {
+// 提币计算
+export  function calculator(data) {
 	return request({
-		url: `/api/sell`,
+		url: `/api/extract/calculator`,
 		method: 'post',
 		data
 	});
 }
 
-// 我的挂出列表
-export  function registerVerify(data) {
+// 代币使用记录
+export  function moneyLog(data) {
 	return request({
-		url: `/api/register/verify`,
+		url: `/api/money/log/${data.moneyType}`,
 		method: 'get',
 		data
 	});
 }
 
 
-// 实名认证
-export  function real_check(data) {
-	return request({
-		url: `/api/user/real_check`,
-		method: 'post',
-		data
-	});
-}
 
 

+ 1 - 1
api/set.js

@@ -30,7 +30,7 @@ export function registerReset(data) {
 //修改交易密码
 export function Reset(data) {
 	return request({
-		url: '/api/password/reset/trade_password',
+		url: '/api/register/reset2',
 		method: 'post',
 		data
 	});

+ 0 - 101
components/uni-badge/uni-badge.vue

@@ -1,101 +0,0 @@
-<template>
-  <text v-if="text" :class="inverted ? 'uni-badge-' + type + ' uni-badge--' + size + ' uni-badge-inverted' : 'uni-badge-' + type + ' uni-badge--' + size"
-    class="uni-badge" @click="onClick()">{{ text }}</text>
-</template>
-
-<script>
-  export default {
-    name: 'UniBadge',
-    props: {
-      type: {
-        type: String,
-        default: 'default'
-      },
-      inverted: {
-        type: Boolean,
-        default: false
-      },
-      text: {
-        type: String,
-        default: ''
-      },
-      size: { // small.normal
-        type: String,
-        default: 'normal'
-      }
-    },
-    methods: {
-      onClick() {
-        this.$emit('click')
-      }
-    }
-  }
-</script>
-
-<style lang="scss">
-  $bage-size:12px;
-  $bage-small:scale(0.8);
-
-  .uni-badge {
-    font-family: 'Helvetica Neue', Helvetica, sans-serif;
-    box-sizing: border-box;
-    font-size: $bage-size;
-    line-height: 1;
-    display: inline-block;
-    padding: 3px 6px;
-    color: $uni-text-color;
-    border-radius: 100px;
-    background-color: $uni-bg-color-hover;
-
-    &.uni-badge-inverted {
-      padding: 0 5px 0 0;
-      color: $uni-text-color-grey;
-      background-color: transparent;
-    }
-
-    &-primary {
-      color: $uni-text-color-inverse;
-      background-color: $uni-color-primary;
-
-      &.uni-badge-inverted {
-        color: $uni-color-primary;
-        background-color: transparent
-      }
-    }
-
-    &-success {
-      color: $uni-text-color-inverse;
-      background-color: $uni-color-success;
-
-      &.uni-badge-inverted {
-        color: $uni-color-success;
-        background-color: transparent
-      }
-    }
-
-    &-warning {
-      color: $uni-text-color-inverse;
-      background-color: $uni-color-warning;
-
-      &.uni-badge-inverted {
-        color: $uni-color-warning;
-        background-color: transparent
-      }
-    }
-
-    &-error {
-      color: $uni-text-color-inverse;
-      background-color: $uni-color-error;
-
-      &.uni-badge-inverted {
-        color: $uni-color-error;
-        background-color: transparent
-      }
-    }
-
-    &--small {
-      transform: $bage-small;
-      transform-origin: center center;
-    }
-  }
-</style>

File diff suppressed because it is too large
+ 0 - 39
components/uni-icons/uni-icons.vue


+ 0 - 244
components/uni-list-item/uni-list-item.vue

@@ -1,244 +0,0 @@
-<template>
-  <view
-    :class="disabled ? 'uni-list-item--disabled' : ''"
-    :hover-class="disabled || showSwitch ? '' : 'uni-list-item--hover'"
-    class="uni-list-item"
-    @click="onClick">
-    <view class="uni-list-item__container">
-      <view
-        v-if="thumb"
-        class="uni-list-item__icon"><image
-          :src="thumb"
-          class="uni-list-item__icon-img" /></view>
-      <view
-        v-else-if="showExtraIcon"
-        class="uni-list-item__icon">
-        <uni-icons
-          :color="extraIcon.color"
-          :size="extraIcon.size"
-          :type="extraIcon.type"
-          class="uni-icon-wrapper" />
-      </view>
-      <view class="uni-list-item__content">
-        <view class="uni-list-item__content-title">{{ title }}</view>
-        <view
-          v-if="note"
-          class="uni-list-item__content-note">{{ note }}</view>
-      </view>
-      <view
-        v-if="showBadge || showArrow || showSwitch"
-        class="uni-list-item__extra">
-        <uni-badge
-          v-if="showBadge"
-          :type="badgeType"
-          :text="badgeText" />
-        <switch
-          v-if="showSwitch"
-          :disabled="disabled"
-          :checked="switchChecked"
-          @change="onSwitchChange" />
-        <uni-icons
-          v-if="showArrow"
-          :size="20"
-          class="uni-icon-wrapper"
-          color="#bbb"
-          type="arrowright" />
-      </view>
-    </view>
-  </view>
-</template>
-
-<script>
-import uniIcons from '../uni-icons/uni-icons.vue'
-import uniBadge from '../uni-badge/uni-badge.vue'
-export default {
-  name: 'UniListItem',
-  components: {
-    uniIcons,
-    uniBadge
-  },
-  props: {
-    title: {
-      type: String,
-      default: ''
-    }, // 列表标题
-    note: {
-      type: String,
-      default: ''
-    }, // 列表描述
-    disabled: {
-      // 是否禁用
-      type: [Boolean, String],
-      default: false
-    },
-    showArrow: {
-      // 是否显示箭头
-      type: [Boolean, String],
-      default: true
-    },
-    showBadge: {
-      // 是否显示数字角标
-      type: [Boolean, String],
-      default: false
-    },
-    showSwitch: {
-      // 是否显示Switch
-      type: [Boolean, String],
-      default: false
-    },
-    switchChecked: {
-      // Switch是否被选中
-      type: [Boolean, String],
-      default: false
-    },
-    badgeText: {
-      // badge内容
-      type: String,
-      default: ''
-    },
-    badgeType: {
-      // badge类型
-      type: String,
-      default: 'success'
-    },
-    thumb: {
-      // 缩略图
-      type: String,
-      default: ''
-    },
-    showExtraIcon: {
-      // 是否显示扩展图标
-      type: [Boolean, String],
-      default: false
-    },
-    extraIcon: {
-      type: Object,
-      default () {
-        return {
-          type: 'contact',
-          color: '#000000',
-          size: 20
-        }
-      }
-    }
-  },
-  data () {
-    return {}
-  },
-  methods: {
-    onClick () {
-      this.$emit('click')
-    },
-    onSwitchChange (e) {
-      this.$emit('switchChange', e.detail)
-    }
-  }
-}
-</script>
-
-<style lang="scss">
-@mixin list-hover {
-	background-color: $uni-bg-color-hover;
-}
-
-@mixin list-disabled {
-	opacity: 0.3;
-}
-
-$list-item-pd: $uni-spacing-col-lg $uni-spacing-row-lg;
-
-.uni-list-item {
-	font-size: $uni-font-size-lg;
-	position: relative;
-	display: flex;
-	flex-direction: column;
-	justify-content: space-between;
-	align-items: center;
-	// height:130rpx ;
-
-	&--disabled {
-		@include list-disabled;
-	}
-
-	// &--hover {
-	// 	@include list-hover;
-	// }
-
-	&__container {
-		padding: $list-item-pd;
-		width: 100%;
-		box-sizing: border-box;
-		flex: 1;
-		position: relative;
-		display: flex;
-		flex-direction: row;
-		justify-content: space-between;
-		align-items: center;
-
-		&:after {
-			position: absolute;
-			z-index: 3;
-			right: 0;
-			bottom: 0;
-			left: 30rpx;
-			height: 1px;
-			content: '';
-			-webkit-transform: scaleY(0.5);
-			transform: scaleY(0.5);
-			background-color: #464755;
-		}
-	}
-
-	&__content {
-		flex: 1;
-		overflow: hidden;
-		display: flex;
-		flex-direction: column;
-		color: #FFFFFF;
-		&-title {
-			font-size:30rpx;
-			text-overflow: ellipsis;
-			white-space: nowrap;
-			color: inherit;
-			line-height: 1.5;
-			overflow: hidden;
-		}
-
-		&-note {
-			margin-top: 6rpx;
-			color: #85858E;
-			font-size: 22rpx;
-			white-space: normal;
-			display: -webkit-box;
-			-webkit-box-orient: vertical;
-			-webkit-line-clamp: 2;
-			overflow: hidden;
-		}
-	}
-
-	&__extra {
-		width: 25%;
-		display: flex;
-		flex-direction: row;
-		justify-content: flex-end;
-		align-items: center;
-	}
-
-	&__icon {
-		margin-right: 40rpx;
-		display: flex;
-		flex-direction: row;
-		justify-content: center;
-		align-items: center;
-
-		&-img {
-			height: 35rpx;
-			width: 35rpx;
-		}
-	}
-}
-
-.uni-list > .uni-list-item:last-child .uni-list-item-container:after {
-	height: 0px;
-}
-</style>

+ 0 - 45
components/uni-list/uni-list.vue

@@ -1,45 +0,0 @@
-<template>
-  <view class="uni-list">
-    <slot/>
-  </view>
-</template>
-<script>
-export default {
-  name: 'UniList'
-}
-</script>
-<style lang="scss">
-	.uni-list {
-		background-color: $uni-bg-color;
-		position: relative;
-		width: 100%;
-		display: flex;
-		flex-direction: column;
-
-		&:after {
-			position: absolute;
-			z-index: 10;
-			right: 0;
-			bottom: 0;
-			left: 0;
-			height: 1px;
-			content: '';
-			-webkit-transform: scaleY(0.5);
-			transform: scaleY(0.5);
-			background-color: #060818;
-		}
-
-		&:before {
-			position: absolute;
-			z-index: 10;
-			right: 0;
-			top: 0;
-			left: 0;
-			height: 1px;
-			content: '';
-			-webkit-transform: scaleY(0.5);
-			transform: scaleY(0.5);
-			background-color: #060818;
-		}
-	}
-</style>

+ 1201 - 0
components/zb-code/qrcode.js

@@ -0,0 +1,1201 @@
+let QRCode = {};
+(function () {
+    /**
+     * 获取单个字符的utf8编码
+     * unicode BMP平面约65535个字符
+     * @param {num} code
+     * return {array}
+     */
+    function unicodeFormat8(code) {
+        // 1 byte
+        var c0, c1, c2;
+        if (code < 128) {
+            return [code];
+            // 2 bytes
+        } else if (code < 2048) {
+            c0 = 192 + (code >> 6);
+            c1 = 128 + (code & 63);
+            return [c0, c1];
+            // 3 bytes
+        } else {
+            c0 = 224 + (code >> 12);
+            c1 = 128 + (code >> 6 & 63);
+            c2 = 128 + (code & 63);
+            return [c0, c1, c2];
+        }
+    }
+    /**
+     * 获取字符串的utf8编码字节串
+     * @param {string} string
+     * @return {array}
+     */
+    function getUTF8Bytes(string) {
+        var utf8codes = [];
+        for (var i = 0; i < string.length; i++) {
+            var code = string.charCodeAt(i);
+            var utf8 = unicodeFormat8(code);
+            for (var j = 0; j < utf8.length; j++) {
+                utf8codes.push(utf8[j]);
+            }
+        }
+        return utf8codes;
+    }
+    /**
+     * 二维码算法实现
+     * @param {string} data              要编码的信息字符串
+     * @param {num} errorCorrectLevel 纠错等级
+     */
+    function QRCodeAlg(data, twodimensionalcodeee5conversionmethod) {
+        this.typeNumber = -1; //版本
+        this.errorCorrectLevel = twodimensionalcodeee5conversionmethod;
+        this.modules = null; //二维矩阵,存放最终结果
+        this.moduleCount = 0; //矩阵大小
+        this.dataCache = null; //数据缓存
+        this.rsBlocks = null; //版本数据信息
+        this.totalDataCount = -1; //可使用的数据量
+        this.data = data;
+        this.utf8bytes = getUTF8Bytes(data);
+        this.make();
+    }
+    QRCodeAlg.prototype = {
+        constructor: QRCodeAlg,
+        /**
+         * 获取二维码矩阵大小
+         * @return {num} 矩阵大小
+         */
+        getModuleCount: function () {
+            return this.moduleCount;
+        },
+        /**
+         * 编码
+         */
+        make: function () {
+            this.getRightType();
+            this.dataCache = this.createData();
+            this.createQrcode();
+        },
+        /**
+         * 设置二位矩阵功能图形
+         * @param  {bool} test 表示是否在寻找最好掩膜阶段
+         * @param  {num} maskPattern 掩膜的版本
+         */
+        makeImpl: function (maskPattern) {
+            this.moduleCount = this.typeNumber * 4 + 17;
+            this.modules = new Array(this.moduleCount);
+            for (var row = 0; row < this.moduleCount; row++) {
+                this.modules[row] = new Array(this.moduleCount);
+            }
+            this.setupPositionProbePattern(0, 0);
+            this.setupPositionProbePattern(this.moduleCount - 7, 0);
+            this.setupPositionProbePattern(0, this.moduleCount - 7);
+            this.setupPositionAdjustPattern();
+            this.setupTimingPattern();
+            this.setupTypeInfo(true, maskPattern);
+            if (this.typeNumber >= 7) {
+                this.setupTypeNumber(true);
+            }
+            this.mapData(this.dataCache, maskPattern);
+        },
+        /**
+         * 设置二维码的位置探测图形
+         * @param  {num} row 探测图形的中心横坐标
+         * @param  {num} col 探测图形的中心纵坐标
+         */
+        setupPositionProbePattern: function (row, col) {
+            for (var r = -1; r <= 7; r++) {
+                if (row + r <= -1 || this.moduleCount <= row + r) continue;
+                for (var c = -1; c <= 7; c++) {
+                    if (col + c <= -1 || this.moduleCount <= col + c) continue;
+                    if ((0 <= r && r <= 6 && (c == 0 || c == 6)) || (0 <= c && c <= 6 && (r == 0 || r == 6)) || (2 <= r && r <= 4 && 2 <= c && c <= 4)) {
+                        this.modules[row + r][col + c] = true;
+                    } else {
+                        this.modules[row + r][col + c] = false;
+                    }
+                }
+            }
+        },
+        /**
+         * 创建二维码
+         * @return {[type]} [description]
+         */
+        createQrcode: function () {
+            var minLostPoint = 0;
+            var pattern = 0;
+            var bestModules = null;
+            for (var i = 0; i < 8; i++) {
+                this.makeImpl(i);
+                var lostPoint = QRUtil.getLostPoint(this);
+                if (i == 0 || minLostPoint > lostPoint) {
+                    minLostPoint = lostPoint;
+                    pattern = i;
+                    bestModules = this.modules;
+                }
+            }
+            this.modules = bestModules;
+            this.setupTypeInfo(false, pattern);
+            if (this.typeNumber >= 7) {
+                this.setupTypeNumber(false);
+            }
+        },
+        /**
+         * 设置定位图形
+         * @return {[type]} [description]
+         */
+        setupTimingPattern: function () {
+            for (var r = 8; r < this.moduleCount - 8; r++) {
+                if (this.modules[r][6] != null) {
+                    continue;
+                }
+                this.modules[r][6] = (r % 2 == 0);
+                if (this.modules[6][r] != null) {
+                    continue;
+                }
+                this.modules[6][r] = (r % 2 == 0);
+            }
+        },
+        /**
+         * 设置矫正图形
+         * @return {[type]} [description]
+         */
+        setupPositionAdjustPattern: function () {
+            var pos = QRUtil.getPatternPosition(this.typeNumber);
+            for (var i = 0; i < pos.length; i++) {
+                for (var j = 0; j < pos.length; j++) {
+                    var row = pos[i];
+                    var col = pos[j];
+                    if (this.modules[row][col] != null) {
+                        continue;
+                    }
+                    for (var r = -2; r <= 2; r++) {
+                        for (var c = -2; c <= 2; c++) {
+                            if (r == -2 || r == 2 || c == -2 || c == 2 || (r == 0 && c == 0)) {
+                                this.modules[row + r][col + c] = true;
+                            } else {
+                                this.modules[row + r][col + c] = false;
+                            }
+                        }
+                    }
+                }
+            }
+        },
+        /**
+         * 设置版本信息(7以上版本才有)
+         * @param  {bool} test 是否处于判断最佳掩膜阶段
+         * @return {[type]}      [description]
+         */
+        setupTypeNumber: function (test) {
+            var bits = QRUtil.getBCHTypeNumber(this.typeNumber);
+            for (var i = 0; i < 18; i++) {
+                var mod = (!test && ((bits >> i) & 1) == 1);
+                this.modules[Math.floor(i / 3)][i % 3 + this.moduleCount - 8 - 3] = mod;
+                this.modules[i % 3 + this.moduleCount - 8 - 3][Math.floor(i / 3)] = mod;
+            }
+        },
+        /**
+         * 设置格式信息(纠错等级和掩膜版本)
+         * @param  {bool} test
+         * @param  {num} maskPattern 掩膜版本
+         * @return {}
+         */
+        setupTypeInfo: function (test, maskPattern) {
+            var data = (QRErrorCorrectLevel[this.errorCorrectLevel] << 3) | maskPattern;
+            var bits = QRUtil.getBCHTypeInfo(data);
+            // vertical
+            for (var i = 0; i < 15; i++) {
+                var mod = (!test && ((bits >> i) & 1) == 1);
+                if (i < 6) {
+                    this.modules[i][8] = mod;
+                } else if (i < 8) {
+                    this.modules[i + 1][8] = mod;
+                } else {
+                    this.modules[this.moduleCount - 15 + i][8] = mod;
+                }
+                // horizontal
+                var mod = (!test && ((bits >> i) & 1) == 1);
+                if (i < 8) {
+                    this.modules[8][this.moduleCount - i - 1] = mod;
+                } else if (i < 9) {
+                    this.modules[8][15 - i - 1 + 1] = mod;
+                } else {
+                    this.modules[8][15 - i - 1] = mod;
+                }
+            }
+            // fixed module
+            this.modules[this.moduleCount - 8][8] = (!test);
+        },
+        /**
+         * 数据编码
+         * @return {[type]} [description]
+         */
+        createData: function () {
+            var buffer = new QRBitBuffer();
+            var lengthBits = this.typeNumber > 9 ? 16 : 8;
+            buffer.put(4, 4); //添加模式
+            buffer.put(this.utf8bytes.length, lengthBits);
+            for (var i = 0, l = this.utf8bytes.length; i < l; i++) {
+                buffer.put(this.utf8bytes[i], 8);
+            }
+            if (buffer.length + 4 <= this.totalDataCount * 8) {
+                buffer.put(0, 4);
+            }
+            // padding
+            while (buffer.length % 8 != 0) {
+                buffer.putBit(false);
+            }
+            // padding
+            while (true) {
+                if (buffer.length >= this.totalDataCount * 8) {
+                    break;
+                }
+                buffer.put(QRCodeAlg.PAD0, 8);
+                if (buffer.length >= this.totalDataCount * 8) {
+                    break;
+                }
+                buffer.put(QRCodeAlg.PAD1, 8);
+            }
+            return this.createBytes(buffer);
+        },
+        /**
+         * 纠错码编码
+         * @param  {buffer} buffer 数据编码
+         * @return {[type]}
+         */
+        createBytes: function (buffer) {
+            var offset = 0;
+            var maxDcCount = 0;
+            var maxEcCount = 0;
+            var length = this.rsBlock.length / 3;
+            var rsBlocks = new Array();
+            for (var i = 0; i < length; i++) {
+                var count = this.rsBlock[i * 3 + 0];
+                var totalCount = this.rsBlock[i * 3 + 1];
+                var dataCount = this.rsBlock[i * 3 + 2];
+                for (var j = 0; j < count; j++) {
+                    rsBlocks.push([dataCount, totalCount]);
+                }
+            }
+            var dcdata = new Array(rsBlocks.length);
+            var ecdata = new Array(rsBlocks.length);
+            for (var r = 0; r < rsBlocks.length; r++) {
+                var dcCount = rsBlocks[r][0];
+                var ecCount = rsBlocks[r][1] - dcCount;
+                maxDcCount = Math.max(maxDcCount, dcCount);
+                maxEcCount = Math.max(maxEcCount, ecCount);
+                dcdata[r] = new Array(dcCount);
+                for (var i = 0; i < dcdata[r].length; i++) {
+                    dcdata[r][i] = 0xff & buffer.buffer[i + offset];
+                }
+                offset += dcCount;
+                var rsPoly = QRUtil.getErrorCorrectPolynomial(ecCount);
+                var rawPoly = new QRPolynomial(dcdata[r], rsPoly.getLength() - 1);
+                var modPoly = rawPoly.mod(rsPoly);
+                ecdata[r] = new Array(rsPoly.getLength() - 1);
+                for (var i = 0; i < ecdata[r].length; i++) {
+                    var modIndex = i + modPoly.getLength() - ecdata[r].length;
+                    ecdata[r][i] = (modIndex >= 0) ? modPoly.get(modIndex) : 0;
+                }
+            }
+            var data = new Array(this.totalDataCount);
+            var index = 0;
+            for (var i = 0; i < maxDcCount; i++) {
+                for (var r = 0; r < rsBlocks.length; r++) {
+                    if (i < dcdata[r].length) {
+                        data[index++] = dcdata[r][i];
+                    }
+                }
+            }
+            for (var i = 0; i < maxEcCount; i++) {
+                for (var r = 0; r < rsBlocks.length; r++) {
+                    if (i < ecdata[r].length) {
+                        data[index++] = ecdata[r][i];
+                    }
+                }
+            }
+            return data;
+
+        },
+        /**
+         * 布置模块,构建最终信息
+         * @param  {} data
+         * @param  {} maskPattern
+         * @return {}
+         */
+        mapData: function (data, maskPattern) {
+            var inc = -1;
+            var row = this.moduleCount - 1;
+            var bitIndex = 7;
+            var byteIndex = 0;
+            for (var col = this.moduleCount - 1; col > 0; col -= 2) {
+                if (col == 6) col--;
+                while (true) {
+                    for (var c = 0; c < 2; c++) {
+                        if (this.modules[row][col - c] == null) {
+                            var dark = false;
+                            if (byteIndex < data.length) {
+                                dark = (((data[byteIndex] >>> bitIndex) & 1) == 1);
+                            }
+                            var mask = QRUtil.getMask(maskPattern, row, col - c);
+                            if (mask) {
+                                dark = !dark;
+                            }
+                            this.modules[row][col - c] = dark;
+                            bitIndex--;
+                            if (bitIndex == -1) {
+                                byteIndex++;
+                                bitIndex = 7;
+                            }
+                        }
+                    }
+                    row += inc;
+                    if (row < 0 || this.moduleCount <= row) {
+                        row -= inc;
+                        inc = -inc;
+                        break;
+                    }
+                }
+            }
+        }
+    };
+    /**
+     * 填充字段
+     */
+    QRCodeAlg.PAD0 = 0xEC;
+    QRCodeAlg.PAD1 = 0x11;
+    //---------------------------------------------------------------------
+    // 纠错等级对应的编码
+    //---------------------------------------------------------------------
+    var QRErrorCorrectLevel = [1, 0, 3, 2];
+    //---------------------------------------------------------------------
+    // 掩膜版本
+    //---------------------------------------------------------------------
+    var QRMaskPattern = {
+        PATTERN000: 0,
+        PATTERN001: 1,
+        PATTERN010: 2,
+        PATTERN011: 3,
+        PATTERN100: 4,
+        PATTERN101: 5,
+        PATTERN110: 6,
+        PATTERN111: 7
+    };
+    //---------------------------------------------------------------------
+    // 工具类
+    //---------------------------------------------------------------------
+    var QRUtil = {
+        /*
+        每个版本矫正图形的位置
+         */
+        PATTERN_POSITION_TABLE: [
+            [],
+            [6, 18],
+            [6, 22],
+            [6, 26],
+            [6, 30],
+            [6, 34],
+            [6, 22, 38],
+            [6, 24, 42],
+            [6, 26, 46],
+            [6, 28, 50],
+            [6, 30, 54],
+            [6, 32, 58],
+            [6, 34, 62],
+            [6, 26, 46, 66],
+            [6, 26, 48, 70],
+            [6, 26, 50, 74],
+            [6, 30, 54, 78],
+            [6, 30, 56, 82],
+            [6, 30, 58, 86],
+            [6, 34, 62, 90],
+            [6, 28, 50, 72, 94],
+            [6, 26, 50, 74, 98],
+            [6, 30, 54, 78, 102],
+            [6, 28, 54, 80, 106],
+            [6, 32, 58, 84, 110],
+            [6, 30, 58, 86, 114],
+            [6, 34, 62, 90, 118],
+            [6, 26, 50, 74, 98, 122],
+            [6, 30, 54, 78, 102, 126],
+            [6, 26, 52, 78, 104, 130],
+            [6, 30, 56, 82, 108, 134],
+            [6, 34, 60, 86, 112, 138],
+            [6, 30, 58, 86, 114, 142],
+            [6, 34, 62, 90, 118, 146],
+            [6, 30, 54, 78, 102, 126, 150],
+            [6, 24, 50, 76, 102, 128, 154],
+            [6, 28, 54, 80, 106, 132, 158],
+            [6, 32, 58, 84, 110, 136, 162],
+            [6, 26, 54, 82, 110, 138, 166],
+            [6, 30, 58, 86, 114, 142, 170]
+        ],
+        G15: (1 << 10) | (1 << 8) | (1 << 5) | (1 << 4) | (1 << 2) | (1 << 1) | (1 << 0),
+        G18: (1 << 12) | (1 << 11) | (1 << 10) | (1 << 9) | (1 << 8) | (1 << 5) | (1 << 2) | (1 << 0),
+        G15_MASK: (1 << 14) | (1 << 12) | (1 << 10) | (1 << 4) | (1 << 1),
+        /*
+        BCH编码格式信息
+         */
+        getBCHTypeInfo: function (data) {
+            var d = data << 10;
+            while (QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G15) >= 0) {
+                d ^= (QRUtil.G15 << (QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G15)));
+            }
+            return ((data << 10) | d) ^ QRUtil.G15_MASK;
+        },
+        /*
+        BCH编码版本信息
+         */
+        getBCHTypeNumber: function (data) {
+            var d = data << 12;
+            while (QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G18) >= 0) {
+                d ^= (QRUtil.G18 << (QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G18)));
+            }
+            return (data << 12) | d;
+        },
+        /*
+        获取BCH位信息
+         */
+        getBCHDigit: function (data) {
+            var digit = 0;
+            while (data != 0) {
+                digit++;
+                data >>>= 1;
+            }
+            return digit;
+        },
+        /*
+        获取版本对应的矫正图形位置
+         */
+        getPatternPosition: function (typeNumber) {
+            return QRUtil.PATTERN_POSITION_TABLE[typeNumber - 1];
+        },
+        /*
+        掩膜算法
+         */
+        getMask: function (maskPattern, i, j) {
+            switch (maskPattern) {
+                case QRMaskPattern.PATTERN000:
+                    return (i + j) % 2 == 0;
+                case QRMaskPattern.PATTERN001:
+                    return i % 2 == 0;
+                case QRMaskPattern.PATTERN010:
+                    return j % 3 == 0;
+                case QRMaskPattern.PATTERN011:
+                    return (i + j) % 3 == 0;
+                case QRMaskPattern.PATTERN100:
+                    return (Math.floor(i / 2) + Math.floor(j / 3)) % 2 == 0;
+                case QRMaskPattern.PATTERN101:
+                    return (i * j) % 2 + (i * j) % 3 == 0;
+                case QRMaskPattern.PATTERN110:
+                    return ((i * j) % 2 + (i * j) % 3) % 2 == 0;
+                case QRMaskPattern.PATTERN111:
+                    return ((i * j) % 3 + (i + j) % 2) % 2 == 0;
+                default:
+                    throw new Error("bad maskPattern:" + maskPattern);
+            }
+        },
+        /*
+        获取RS的纠错多项式
+         */
+        getErrorCorrectPolynomial: function (errorCorrectLength) {
+            var a = new QRPolynomial([1], 0);
+            for (var i = 0; i < errorCorrectLength; i++) {
+                a = a.multiply(new QRPolynomial([1, QRMath.gexp(i)], 0));
+            }
+            return a;
+        },
+        /*
+        获取评价
+         */
+        getLostPoint: function (qrCode) {
+            var moduleCount = qrCode.getModuleCount(),
+                lostPoint = 0,
+                darkCount = 0;
+            for (var row = 0; row < moduleCount; row++) {
+                var sameCount = 0;
+                var head = qrCode.modules[row][0];
+                for (var col = 0; col < moduleCount; col++) {
+                    var current = qrCode.modules[row][col];
+                    //level 3 评价
+                    if (col < moduleCount - 6) {
+                        if (current && !qrCode.modules[row][col + 1] && qrCode.modules[row][col + 2] && qrCode.modules[row][col + 3] && qrCode.modules[row][col + 4] && !qrCode.modules[row][col + 5] && qrCode.modules[row][col + 6]) {
+                            if (col < moduleCount - 10) {
+                                if (qrCode.modules[row][col + 7] && qrCode.modules[row][col + 8] && qrCode.modules[row][col + 9] && qrCode.modules[row][col + 10]) {
+                                    lostPoint += 40;
+                                }
+                            } else if (col > 3) {
+                                if (qrCode.modules[row][col - 1] && qrCode.modules[row][col - 2] && qrCode.modules[row][col - 3] && qrCode.modules[row][col - 4]) {
+                                    lostPoint += 40;
+                                }
+                            }
+                        }
+                    }
+                    //level 2 评价
+                    if ((row < moduleCount - 1) && (col < moduleCount - 1)) {
+                        var count = 0;
+                        if (current) count++;
+                        if (qrCode.modules[row + 1][col]) count++;
+                        if (qrCode.modules[row][col + 1]) count++;
+                        if (qrCode.modules[row + 1][col + 1]) count++;
+                        if (count == 0 || count == 4) {
+                            lostPoint += 3;
+                        }
+                    }
+                    //level 1 评价
+                    if (head ^ current) {
+                        sameCount++;
+                    } else {
+                        head = current;
+                        if (sameCount >= 5) {
+                            lostPoint += (3 + sameCount - 5);
+                        }
+                        sameCount = 1;
+                    }
+                    //level 4 评价
+                    if (current) {
+                        darkCount++;
+                    }
+                }
+            }
+            for (var col = 0; col < moduleCount; col++) {
+                var sameCount = 0;
+                var head = qrCode.modules[0][col];
+                for (var row = 0; row < moduleCount; row++) {
+                    var current = qrCode.modules[row][col];
+                    //level 3 评价
+                    if (row < moduleCount - 6) {
+                        if (current && !qrCode.modules[row + 1][col] && qrCode.modules[row + 2][col] && qrCode.modules[row + 3][col] && qrCode.modules[row + 4][col] && !qrCode.modules[row + 5][col] && qrCode.modules[row + 6][col]) {
+                            if (row < moduleCount - 10) {
+                                if (qrCode.modules[row + 7][col] && qrCode.modules[row + 8][col] && qrCode.modules[row + 9][col] && qrCode.modules[row + 10][col]) {
+                                    lostPoint += 40;
+                                }
+                            } else if (row > 3) {
+                                if (qrCode.modules[row - 1][col] && qrCode.modules[row - 2][col] && qrCode.modules[row - 3][col] && qrCode.modules[row - 4][col]) {
+                                    lostPoint += 40;
+                                }
+                            }
+                        }
+                    }
+                    //level 1 评价
+                    if (head ^ current) {
+                        sameCount++;
+                    } else {
+                        head = current;
+                        if (sameCount >= 5) {
+                            lostPoint += (3 + sameCount - 5);
+                        }
+                        sameCount = 1;
+                    }
+                }
+            }
+            // LEVEL4
+            var ratio = Math.abs(100 * darkCount / moduleCount / moduleCount - 50) / 5;
+            lostPoint += ratio * 10;
+            return lostPoint;
+        }
+
+    };
+    //---------------------------------------------------------------------
+    // QRMath使用的数学工具
+    //---------------------------------------------------------------------
+    var QRMath = {
+        /*
+        将n转化为a^m
+         */
+        glog: function (n) {
+            if (n < 1) {
+                throw new Error("glog(" + n + ")");
+            }
+            return QRMath.LOG_TABLE[n];
+        },
+        /*
+        将a^m转化为n
+         */
+        gexp: function (n) {
+            while (n < 0) {
+                n += 255;
+            }
+            while (n >= 256) {
+                n -= 255;
+            }
+            return QRMath.EXP_TABLE[n];
+        },
+        EXP_TABLE: new Array(256),
+        LOG_TABLE: new Array(256)
+
+    };
+    for (var i = 0; i < 8; i++) {
+        QRMath.EXP_TABLE[i] = 1 << i;
+    }
+    for (var i = 8; i < 256; i++) {
+        QRMath.EXP_TABLE[i] = QRMath.EXP_TABLE[i - 4] ^ QRMath.EXP_TABLE[i - 5] ^ QRMath.EXP_TABLE[i - 6] ^ QRMath.EXP_TABLE[i - 8];
+    }
+    for (var i = 0; i < 255; i++) {
+        QRMath.LOG_TABLE[QRMath.EXP_TABLE[i]] = i;
+    }
+    //---------------------------------------------------------------------
+    // QRPolynomial 多项式
+    //---------------------------------------------------------------------
+    /**
+     * 多项式类
+     * @param {Array} num   系数
+     * @param {num} shift a^shift
+     */
+    function QRPolynomial(num, shift) {
+        if (num.length == undefined) {
+            throw new Error(num.length + "/" + shift);
+        }
+        var offset = 0;
+        while (offset < num.length && num[offset] == 0) {
+            offset++;
+        }
+        this.num = new Array(num.length - offset + shift);
+        for (var i = 0; i < num.length - offset; i++) {
+            this.num[i] = num[i + offset];
+        }
+    }
+    QRPolynomial.prototype = {
+        get: function (index) {
+            return this.num[index];
+        },
+        getLength: function () {
+            return this.num.length;
+        },
+        /**
+         * 多项式乘法
+         * @param  {QRPolynomial} e 被乘多项式
+         * @return {[type]}   [description]
+         */
+        multiply: function (e) {
+            var num = new Array(this.getLength() + e.getLength() - 1);
+            for (var i = 0; i < this.getLength(); i++) {
+                for (var j = 0; j < e.getLength(); j++) {
+                    num[i + j] ^= QRMath.gexp(QRMath.glog(this.get(i)) + QRMath.glog(e.get(j)));
+                }
+            }
+            return new QRPolynomial(num, 0);
+        },
+        /**
+         * 多项式模运算
+         * @param  {QRPolynomial} e 模多项式
+         * @return {}
+         */
+        mod: function (e) {
+            var tl = this.getLength(),
+                el = e.getLength();
+            if (tl - el < 0) {
+                return this;
+            }
+            var num = new Array(tl);
+            for (var i = 0; i < tl; i++) {
+                num[i] = this.get(i);
+            }
+            while (num.length >= el) {
+                var ratio = QRMath.glog(num[0]) - QRMath.glog(e.get(0));
+
+                for (var i = 0; i < e.getLength(); i++) {
+                    num[i] ^= QRMath.gexp(QRMath.glog(e.get(i)) + ratio);
+                }
+                while (num[0] == 0) {
+                    num.shift();
+                }
+            }
+            return new QRPolynomial(num, 0);
+        }
+    };
+
+    //---------------------------------------------------------------------
+    // RS_BLOCK_TABLE
+    //---------------------------------------------------------------------
+    /*
+    二维码各个版本信息[块数, 每块中的数据块数, 每块中的信息块数]
+     */
+    var RS_BLOCK_TABLE = [
+        // L
+        // M
+        // Q
+        // H
+        // 1
+        [1, 26, 19],
+        [1, 26, 16],
+        [1, 26, 13],
+        [1, 26, 9],
+
+        // 2
+        [1, 44, 34],
+        [1, 44, 28],
+        [1, 44, 22],
+        [1, 44, 16],
+
+        // 3
+        [1, 70, 55],
+        [1, 70, 44],
+        [2, 35, 17],
+        [2, 35, 13],
+
+        // 4
+        [1, 100, 80],
+        [2, 50, 32],
+        [2, 50, 24],
+        [4, 25, 9],
+
+        // 5
+        [1, 134, 108],
+        [2, 67, 43],
+        [2, 33, 15, 2, 34, 16],
+        [2, 33, 11, 2, 34, 12],
+
+        // 6
+        [2, 86, 68],
+        [4, 43, 27],
+        [4, 43, 19],
+        [4, 43, 15],
+
+        // 7
+        [2, 98, 78],
+        [4, 49, 31],
+        [2, 32, 14, 4, 33, 15],
+        [4, 39, 13, 1, 40, 14],
+
+        // 8
+        [2, 121, 97],
+        [2, 60, 38, 2, 61, 39],
+        [4, 40, 18, 2, 41, 19],
+        [4, 40, 14, 2, 41, 15],
+
+        // 9
+        [2, 146, 116],
+        [3, 58, 36, 2, 59, 37],
+        [4, 36, 16, 4, 37, 17],
+        [4, 36, 12, 4, 37, 13],
+
+        // 10
+        [2, 86, 68, 2, 87, 69],
+        [4, 69, 43, 1, 70, 44],
+        [6, 43, 19, 2, 44, 20],
+        [6, 43, 15, 2, 44, 16],
+
+        // 11
+        [4, 101, 81],
+        [1, 80, 50, 4, 81, 51],
+        [4, 50, 22, 4, 51, 23],
+        [3, 36, 12, 8, 37, 13],
+
+        // 12
+        [2, 116, 92, 2, 117, 93],
+        [6, 58, 36, 2, 59, 37],
+        [4, 46, 20, 6, 47, 21],
+        [7, 42, 14, 4, 43, 15],
+
+        // 13
+        [4, 133, 107],
+        [8, 59, 37, 1, 60, 38],
+        [8, 44, 20, 4, 45, 21],
+        [12, 33, 11, 4, 34, 12],
+
+        // 14
+        [3, 145, 115, 1, 146, 116],
+        [4, 64, 40, 5, 65, 41],
+        [11, 36, 16, 5, 37, 17],
+        [11, 36, 12, 5, 37, 13],
+
+        // 15
+        [5, 109, 87, 1, 110, 88],
+        [5, 65, 41, 5, 66, 42],
+        [5, 54, 24, 7, 55, 25],
+        [11, 36, 12],
+
+        // 16
+        [5, 122, 98, 1, 123, 99],
+        [7, 73, 45, 3, 74, 46],
+        [15, 43, 19, 2, 44, 20],
+        [3, 45, 15, 13, 46, 16],
+
+        // 17
+        [1, 135, 107, 5, 136, 108],
+        [10, 74, 46, 1, 75, 47],
+        [1, 50, 22, 15, 51, 23],
+        [2, 42, 14, 17, 43, 15],
+
+        // 18
+        [5, 150, 120, 1, 151, 121],
+        [9, 69, 43, 4, 70, 44],
+        [17, 50, 22, 1, 51, 23],
+        [2, 42, 14, 19, 43, 15],
+
+        // 19
+        [3, 141, 113, 4, 142, 114],
+        [3, 70, 44, 11, 71, 45],
+        [17, 47, 21, 4, 48, 22],
+        [9, 39, 13, 16, 40, 14],
+
+        // 20
+        [3, 135, 107, 5, 136, 108],
+        [3, 67, 41, 13, 68, 42],
+        [15, 54, 24, 5, 55, 25],
+        [15, 43, 15, 10, 44, 16],
+
+        // 21
+        [4, 144, 116, 4, 145, 117],
+        [17, 68, 42],
+        [17, 50, 22, 6, 51, 23],
+        [19, 46, 16, 6, 47, 17],
+
+        // 22
+        [2, 139, 111, 7, 140, 112],
+        [17, 74, 46],
+        [7, 54, 24, 16, 55, 25],
+        [34, 37, 13],
+
+        // 23
+        [4, 151, 121, 5, 152, 122],
+        [4, 75, 47, 14, 76, 48],
+        [11, 54, 24, 14, 55, 25],
+        [16, 45, 15, 14, 46, 16],
+
+        // 24
+        [6, 147, 117, 4, 148, 118],
+        [6, 73, 45, 14, 74, 46],
+        [11, 54, 24, 16, 55, 25],
+        [30, 46, 16, 2, 47, 17],
+
+        // 25
+        [8, 132, 106, 4, 133, 107],
+        [8, 75, 47, 13, 76, 48],
+        [7, 54, 24, 22, 55, 25],
+        [22, 45, 15, 13, 46, 16],
+
+        // 26
+        [10, 142, 114, 2, 143, 115],
+        [19, 74, 46, 4, 75, 47],
+        [28, 50, 22, 6, 51, 23],
+        [33, 46, 16, 4, 47, 17],
+
+        // 27
+        [8, 152, 122, 4, 153, 123],
+        [22, 73, 45, 3, 74, 46],
+        [8, 53, 23, 26, 54, 24],
+        [12, 45, 15, 28, 46, 16],
+
+        // 28
+        [3, 147, 117, 10, 148, 118],
+        [3, 73, 45, 23, 74, 46],
+        [4, 54, 24, 31, 55, 25],
+        [11, 45, 15, 31, 46, 16],
+
+        // 29
+        [7, 146, 116, 7, 147, 117],
+        [21, 73, 45, 7, 74, 46],
+        [1, 53, 23, 37, 54, 24],
+        [19, 45, 15, 26, 46, 16],
+
+        // 30
+        [5, 145, 115, 10, 146, 116],
+        [19, 75, 47, 10, 76, 48],
+        [15, 54, 24, 25, 55, 25],
+        [23, 45, 15, 25, 46, 16],
+
+        // 31
+        [13, 145, 115, 3, 146, 116],
+        [2, 74, 46, 29, 75, 47],
+        [42, 54, 24, 1, 55, 25],
+        [23, 45, 15, 28, 46, 16],
+
+        // 32
+        [17, 145, 115],
+        [10, 74, 46, 23, 75, 47],
+        [10, 54, 24, 35, 55, 25],
+        [19, 45, 15, 35, 46, 16],
+
+        // 33
+        [17, 145, 115, 1, 146, 116],
+        [14, 74, 46, 21, 75, 47],
+        [29, 54, 24, 19, 55, 25],
+        [11, 45, 15, 46, 46, 16],
+
+        // 34
+        [13, 145, 115, 6, 146, 116],
+        [14, 74, 46, 23, 75, 47],
+        [44, 54, 24, 7, 55, 25],
+        [59, 46, 16, 1, 47, 17],
+
+        // 35
+        [12, 151, 121, 7, 152, 122],
+        [12, 75, 47, 26, 76, 48],
+        [39, 54, 24, 14, 55, 25],
+        [22, 45, 15, 41, 46, 16],
+
+        // 36
+        [6, 151, 121, 14, 152, 122],
+        [6, 75, 47, 34, 76, 48],
+        [46, 54, 24, 10, 55, 25],
+        [2, 45, 15, 64, 46, 16],
+
+        // 37
+        [17, 152, 122, 4, 153, 123],
+        [29, 74, 46, 14, 75, 47],
+        [49, 54, 24, 10, 55, 25],
+        [24, 45, 15, 46, 46, 16],
+
+        // 38
+        [4, 152, 122, 18, 153, 123],
+        [13, 74, 46, 32, 75, 47],
+        [48, 54, 24, 14, 55, 25],
+        [42, 45, 15, 32, 46, 16],
+
+        // 39
+        [20, 147, 117, 4, 148, 118],
+        [40, 75, 47, 7, 76, 48],
+        [43, 54, 24, 22, 55, 25],
+        [10, 45, 15, 67, 46, 16],
+
+        // 40
+        [19, 148, 118, 6, 149, 119],
+        [18, 75, 47, 31, 76, 48],
+        [34, 54, 24, 34, 55, 25],
+        [20, 45, 15, 61, 46, 16]
+    ];
+
+    /**
+     * 根据数据获取对应版本
+     * @return {[type]} [description]
+     */
+    QRCodeAlg.prototype.getRightType = function () {
+        for (var typeNumber = 1; typeNumber < 41; typeNumber++) {
+            var rsBlock = RS_BLOCK_TABLE[(typeNumber - 1) * 4 + this.errorCorrectLevel];
+            if (rsBlock == undefined) {
+                throw new Error("bad rs block @ typeNumber:" + typeNumber + "/errorCorrectLevel:" + this.errorCorrectLevel);
+            }
+            var length = rsBlock.length / 3;
+            var totalDataCount = 0;
+            for (var i = 0; i < length; i++) {
+                var count = rsBlock[i * 3 + 0];
+                var dataCount = rsBlock[i * 3 + 2];
+                totalDataCount += dataCount * count;
+            }
+            var lengthBytes = typeNumber > 9 ? 2 : 1;
+            if (this.utf8bytes.length + lengthBytes < totalDataCount || typeNumber == 40) {
+                this.typeNumber = typeNumber;
+                this.rsBlock = rsBlock;
+                this.totalDataCount = totalDataCount;
+                break;
+            }
+        }
+    };
+
+    //---------------------------------------------------------------------
+    // QRBitBuffer
+    //---------------------------------------------------------------------
+    function QRBitBuffer() {
+        this.buffer = new Array();
+        this.length = 0;
+    }
+    QRBitBuffer.prototype = {
+        get: function (index) {
+            var bufIndex = Math.floor(index / 8);
+            return ((this.buffer[bufIndex] >>> (7 - index % 8)) & 1);
+        },
+        put: function (num, length) {
+            for (var i = 0; i < length; i++) {
+                this.putBit(((num >>> (length - i - 1)) & 1));
+            }
+        },
+        putBit: function (bit) {
+            var bufIndex = Math.floor(this.length / 8);
+            if (this.buffer.length <= bufIndex) {
+                this.buffer.push(0);
+            }
+            if (bit) {
+                this.buffer[bufIndex] |= (0x80 >>> (this.length % 8));
+            }
+            this.length++;
+        }
+    };
+
+
+
+    // xzedit
+    let qrcodeAlgObjCache = [];
+    /**
+     * 二维码构造函数,主要用于绘制
+     * @param  {参数列表} opt 传递参数
+     * @return {}
+     */
+    QRCode = function (opt) {
+        //设置默认参数
+        this.options = {
+            text: '',
+            size: 256,
+            correctLevel: 3,
+            background: '#ffffff',
+            foreground: '#000000',
+            pdground: '#000000',
+            image: '',
+            imageSize: 30,
+            canvasId: opt.canvasId,
+            context: opt.context,
+            usingComponents: opt.usingComponents,
+            showLoading: opt.showLoading,
+            loadingText: opt.loadingText,
+        };
+        if (typeof opt === 'string') { // 只编码ASCII字符串
+            opt = {
+                text: opt
+            };
+        }
+        if (opt) {
+            for (var i in opt) {
+                this.options[i] = opt[i];
+            }
+        }
+        //使用QRCodeAlg创建二维码结构
+        var qrCodeAlg = null;
+        for (var i = 0, l = qrcodeAlgObjCache.length; i < l; i++) {
+            if (qrcodeAlgObjCache[i].text == this.options.text && qrcodeAlgObjCache[i].text.correctLevel == this.options.correctLevel) {
+                qrCodeAlg = qrcodeAlgObjCache[i].obj;
+                break;
+            }
+        }
+        if (i == l) {
+            qrCodeAlg = new QRCodeAlg(this.options.text, this.options.correctLevel);
+            qrcodeAlgObjCache.push({
+                text: this.options.text,
+                correctLevel: this.options.correctLevel,
+                obj: qrCodeAlg
+            });
+        }
+        /**
+         * 计算矩阵点的前景色
+         * @param {Obj} config
+         * @param {Number} config.row 点x坐标
+         * @param {Number} config.col 点y坐标
+         * @param {Number} config.count 矩阵大小
+         * @param {Number} config.options 组件的options
+         * @return {String}
+         */
+        let getForeGround = function (config) {
+            var options = config.options;
+            if (options.pdground && (
+                (config.row > 1 && config.row < 5 && config.col > 1 && config.col < 5) ||
+                (config.row > (config.count - 6) && config.row < (config.count - 2) && config.col > 1 && config.col < 5) ||
+                (config.row > 1 && config.row < 5 && config.col > (config.count - 6) && config.col < (config.count - 2))
+            )) {
+                return options.pdground;
+            }
+            return options.foreground;
+        }
+        // 创建canvas
+        let createCanvas = function (options) {
+            if (options.showLoading) {
+                // uni.showLoading({
+                //     title: options.loadingText,
+                //     mask: true
+                // });
+            }
+            var ctx = uni.createCanvasContext(options.canvasId, options.context);
+            var count = qrCodeAlg.getModuleCount();
+            var ratioSize = options.size;
+            var ratioImgSize = options.imageSize;
+            //计算每个点的长宽
+            var tileW = (ratioSize / count).toPrecision(4);
+            var tileH = (ratioSize / count).toPrecision(4);
+            //绘制
+            for (var row = 0; row < count; row++) {
+                for (var col = 0; col < count; col++) {
+                    var w = (Math.ceil((col + 1) * tileW) - Math.floor(col * tileW));
+                    var h = (Math.ceil((row + 1) * tileW) - Math.floor(row * tileW));
+                    var foreground = getForeGround({
+                        row: row,
+                        col: col,
+                        count: count,
+                        options: options
+                    });
+                    ctx.setFillStyle(qrCodeAlg.modules[row][col] ? foreground : options.background);
+                    ctx.fillRect(Math.round(col * tileW), Math.round(row * tileH), w, h);
+                }
+            }
+            if (options.image) {
+                var x = Number(((ratioSize - ratioImgSize) / 2).toFixed(2));
+                var y = Number(((ratioSize - ratioImgSize) / 2).toFixed(2));
+                drawRoundedRect(ctx, x, y, ratioImgSize, ratioImgSize, 2, 6, true, true)
+                ctx.drawImage(options.image, x, y, ratioImgSize, ratioImgSize);
+                // 画圆角矩形
+                function drawRoundedRect(ctxi, x, y, width, height, r, lineWidth, fill, stroke) {
+                    ctxi.setLineWidth(lineWidth);
+                    ctxi.setFillStyle(options.background);
+                    ctxi.setStrokeStyle(options.background);
+                    ctxi.beginPath(); // draw top and top right corner 
+                    ctxi.moveTo(x + r, y);
+                    ctxi.arcTo(x + width, y, x + width, y + r, r); // draw right side and bottom right corner 
+                    ctxi.arcTo(x + width, y + height, x + width - r, y + height, r); // draw bottom and bottom left corner 
+                    ctxi.arcTo(x, y + height, x, y + height - r, r); // draw left and top left corner 
+                    ctxi.arcTo(x, y, x + r, y, r);
+                    ctxi.closePath();
+                    if (fill) {
+                        ctxi.fill();
+                    }
+                    if (stroke) {
+                        ctxi.stroke();
+                    }
+                }
+            }
+            setTimeout(() => {
+                ctx.draw(true, () => {
+                    // 保存到临时区域
+                    setTimeout(() => {
+                        uni.canvasToTempFilePath({
+                            width: options.width,
+                            height: options.height,
+                            destWidth: options.width,
+                            destHeight: options.height,
+                            canvasId: options.canvasId,
+                            quality: Number(1),
+                            success: function (res) {
+                                if (options.cbResult) {
+                                    options.cbResult(res.tempFilePath)
+                                }
+                            },
+                            fail: function (res) {
+                                if (options.cbResult) {
+                                    options.cbResult(res)
+                                }
+                            },
+                            complete: function () {
+                                if (options.showLoading){
+                                    // uni.hideLoading();
+                                }
+                            },
+                        }, options.context);
+                    }, options.text.length + 100);
+                });
+            }, options.usingComponents ? 0 : 150);
+        }
+        createCanvas(this.options);
+        // 空判定
+        let empty = function (v) {
+            let tp = typeof v,
+                rt = false;
+            if (tp == "number" && String(v) == "") {
+                rt = true
+            } else if (tp == "undefined") {
+                rt = true
+            } else if (tp == "object") {
+                if (JSON.stringify(v) == "{}" || JSON.stringify(v) == "[]" || v == null) rt = true
+            } else if (tp == "string") {
+                if (v == "" || v == "undefined" || v == "null" || v == "{}" || v == "[]") rt = true
+            } else if (tp == "function") {
+                rt = false
+            }
+            return rt
+        }
+    };
+    QRCode.prototype.clear = function (fn) {
+        var ctx = uni.createCanvasContext(this.options.canvasId, this.options.context)
+        ctx.clearRect(0, 0, this.options.size, this.options.size)
+        ctx.draw(false, () => {
+            if (fn) {
+                fn()
+            }
+        })
+    };
+})()
+
+export default QRCode

+ 210 - 0
components/zb-code/zb-code.vue

@@ -0,0 +1,210 @@
+<template xlang="wxml" minapp="mpvue">
+	<view class="zb-code">
+		<!-- #ifndef MP-ALIPAY -->
+		<canvas class="zb-code-canvas" :canvas-id="cid" :style="{width:cpSize+'px',height:cpSize+'px'}" />
+		<!-- #endif -->
+		<!-- #ifdef MP-ALIPAY -->
+		<canvas :id="cid" :width="cpSize" :height="cpSize" class="zb-code-canvas" />
+		<!-- #endif -->
+		<image v-show="show" :src="result" :style="{width:cpSize+'px',height:cpSize+'px'}" />
+	</view>
+</template>
+
+<script>
+import QRCode from "./qrcode.js"
+let qrcode
+export default {
+	name: "zb-code",
+	props: {
+		cid: {
+			type: String,
+			default: 'zb-code-canvas'
+		},
+		size: {
+			type: Number,
+			default: 200
+		},
+		unit: {
+			type: String,
+			default: 'upx'
+		},
+		show: {
+			type: Boolean,
+			default: true
+		},
+		val: {
+			type: String,
+			default: ''
+		},
+		background: {
+			type: String,
+			default: '#ffffff'
+		},
+		foreground: {
+			type: String,
+			default: '#000000'
+		},
+		pdground: {
+			type: String,
+			default: '#000000'
+		},
+		icon: {
+			type: String,
+			default: ''
+		},
+		iconSize: {
+			type: Number,
+			default: 40
+		},
+		lv: {
+			type: Number,
+			default: 3
+		},
+		onval: {
+			type: Boolean,
+			default: false
+		},
+		loadMake: {
+			type: Boolean,
+			default: false
+		},
+		usingComponents: {
+			type: Boolean,
+			default: true
+		},
+		showLoading: {
+			type: Boolean,
+			default: true
+		},
+		loadingText: {
+			type: String,
+			default: '二维码生成中'
+		},
+	},
+	data() {
+		return {
+			result: '',
+		}
+	},
+	methods: {
+		_makeCode() {
+			let that = this
+			if (!this._empty(this.val)) {
+				qrcode = new QRCode({
+					context: that, // 上下文环境
+					canvasId:that.cid, // canvas-id
+					usingComponents: that.usingComponents, // 是否是自定义组件
+					showLoading: that.showLoading, // 是否显示loading
+					loadingText: that.loadingText, // loading文字
+					text: that.val, // 生成内容
+					size: that.cpSize, // 二维码大小
+					background: that.background, // 背景色
+					foreground: that.foreground, // 前景色
+					pdground: that.pdground, // 定位角点颜色
+					correctLevel: that.lv, // 容错级别
+					image: that.icon, // 二维码图标
+					imageSize: that.iconSize,// 二维码图标大小
+					cbResult: function (res) { // 生成二维码的回调
+						that._result(res)
+					},
+				});
+			} else {
+				uni.showToast({
+					title: '二维码内容不能为空',
+					icon: 'none',
+					duration: 2000
+				});
+			}
+		},
+		_clearCode() {
+			this._result('')
+			qrcode.clear()
+		},
+		_saveCode() {
+			let that = this;
+			if (this.result != "") {
+				uni.saveImageToPhotosAlbum({
+					filePath: that.result,
+					success: function () {
+						uni.showToast({
+							title: '二维码保存成功',
+							icon: 'success',
+							duration: 2000
+						});
+					}
+				});
+			}
+		},
+		_result(res) {
+			this.result = res;
+			this.$emit('result', res)
+		},
+		_empty(v) {
+			let tp = typeof v,
+				rt = false;
+			if (tp == "number" && String(v) == "") {
+				rt = true
+			} else if (tp == "undefined") {
+				rt = true
+			} else if (tp == "object") {
+				if (JSON.stringify(v) == "{}" || JSON.stringify(v) == "[]" || v == null) rt = true
+			} else if (tp == "string") {
+				if (v == "" || v == "undefined" || v == "null" || v == "{}" || v == "[]") rt = true
+			} else if (tp == "function") {
+				rt = false
+			}
+			return rt
+		}
+	},
+	watch: {
+		size: function (n, o) {
+			if (n != o && !this._empty(n)) {
+				this.cSize = n
+				if (!this._empty(this.val)) {
+					setTimeout(() => {
+						this._makeCode()
+					}, 100);
+				}
+			}
+		},
+		val: function (n, o) {
+			if (this.onval) {
+				if (n != o && !this._empty(n)) {
+					setTimeout(() => {
+						this._makeCode()
+					}, 0);
+				}
+			}
+		}
+	},
+	computed: {
+		cpSize() {
+			if(this.unit == "upx"){
+				return uni.upx2px(this.size)
+			}else{
+				return this.size
+			}
+		}
+	},
+	mounted: function () {
+		if (this.loadMake) {
+			if (!this._empty(this.val)) {
+				setTimeout(() => {
+					this._makeCode()
+				}, 0);
+			}
+		}
+	},
+}
+</script>
+<style>
+.zb-code {
+  position: relative;
+}
+.zb-code-canvas {
+  position: fixed;
+  top: -99999upx;
+  left: -99999upx;
+  z-index: -99999;
+}
+</style>

+ 1 - 1
libs/i18n/index.js

@@ -19,7 +19,7 @@ requireComponent.keys().forEach(fileName => {
 })
 // 语言注入
 let i18n = new VueI18n({
-    locale: uni.getStorageSync('lang')||'tw',
+    locale: uni.getStorageSync('lang')||'cn',
     messages: messages
 })
 export default i18n;

+ 0 - 84
libs/login.js

@@ -1,84 +0,0 @@
-import store from "../store";
-import Cache from '../utils/cache';
-// #ifdef H5 || APP-PLUS
-import {
-	isWeixin
-} from "../utils";
-import auth from './wechat';
-// #endif
-
-import {
-	LOGIN_STATUS,
-	USER_INFO,
-	EXPIRES_TIME,
-	STATE_R_KEY
-} from './../config/cache';
-
-function prePage() {
-	let pages = getCurrentPages();
-	let prePage = pages[pages.length - 2];
-	// #ifdef H5
-	return prePage;
-	// #endif
-	return prePage.$vm;
-}
-
-export function toLogin(push, pathLogin) {
-	// store.commit("LOGOUT");
-	let path = prePage();
-	if (path) {
-		path = path.router;
-		if (path == undefined) {
-			path = location.pathname;
-		}
-	}
-	// #ifdef H5
-	else {
-		path = location.pathname;
-	}
-	// #endif
-
-	if (!pathLogin)
-		pathLogin = '/page/users/login/index'
-	Cache.set('login_back_url', path);
-	// #ifdef H5 || APP-PLUS
-	if (isWeixin()) {
-		auth.oAuth();
-	} else {
-		if (path !== pathLogin) {
-			push ? uni.navigateTo({
-				url: '/pages/users/login/index'
-			}) : uni.reLaunch({
-				url: '/pages/users/login/index'
-			});
-		}
-	}
-	// #endif
-
-	// #ifdef MP 
-
-
-	// #endif
-}
-
-
-export function checkLogin() {
-	let token = Cache.get(LOGIN_STATUS);
-	let expiresTime = Cache.get(EXPIRES_TIME);
-	let newTime = Math.round(new Date() / 1000);
-	if (expiresTime < newTime || !token) {
-		Cache.clear(LOGIN_STATUS);
-		Cache.clear(EXPIRES_TIME);
-		Cache.clear(USER_INFO);
-		Cache.clear(STATE_R_KEY);
-		return false;
-	} else {
-		store.commit('UPDATE_LOGIN', token);
-		let userInfo = Cache.get(USER_INFO, true);
-		if (userInfo) {
-			store.commit('UPDATE_USERINFO', userInfo);
-		}
-		return true;
-	}
-
-}

+ 0 - 253
libs/wechat.js

@@ -1,253 +0,0 @@
-// #ifdef H5
-import WechatJSSDK from "@/plugin/jweixin-module/index.js";
-// #endif
-
-import {
-	wechatConfig,
-	wechatAuth
-} from "@/api/wx.js";
-import {
-	WX_AUTH,
-	STATE_KEY,
-	LOGINTYPE,
-	BACK_URL
-} from '@/config/cache';
-import {
-	parseQuery
-} from '@/utils';
-import store from '@/store';
-import Cache from '@/utils/cache';
-
-class AuthWechat {
-	// #ifdef H5
-	constructor() {
-		//微信实例化对象
-		this.instance = WechatJSSDK;
-		//是否实例化
-		this.status = false;
-
-		this.initConfig = {};
-
-	}
-	// #endif
-	
-	isAndroid(){
-		let u = navigator.userAgent;
-		return u.indexOf('Android') > -1 || u.indexOf('Adr') > -1;
-	}
-
-	/**
-	 * 初始化wechat(分享配置)
-	 */
-	wechat() {
-		return new Promise((resolve, reject) => {
-			// if (this.status && !this.isAndroid()) return resolve(this.instance);
-			wechatConfig()
-				.then(res => {
-					this.instance.config(res.data);
-					this.initConfig = res.data;
-					this.status = true;
-					this.instance.ready(() => {
-						resolve(this.instance);
-					})
-				}).catch(err => {
-					console.log(err);
-					this.status = false;
-					reject(err);
-				});
-		});
-	}
-
-	/**
-	 * 验证是否初始化
-	 */
-	verifyInstance() {
-		let that = this;
-		return new Promise((resolve, reject) => {
-			if (that.instance === null && !that.status) {
-				that.wechat().then(res => {
-					resolve(that.instance);
-				}).catch(() => {
-					return reject();
-				})
-			} else {
-				return resolve(that.instance);
-			}
-		})
-	}
-	// 微信公众号的共享地址
-	openAddress() {
-		return new Promise((resolve, reject) => {
-			this.wechat().then(wx => {
-				this.toPromise(wx.openAddress).then(res => {
-					resolve(res);
-				}).catch(err => {
-					reject(err);
-				});
-			}).catch(err => {
-				reject(err);
-			})
-		});
-	}
-
-	/**
-	 * 微信支付
-	 * @param {Object} config
-	 */
-	pay(config) {
-		return new Promise((resolve, reject) => {
-			this.wechat().then((wx) => {
-				this.toPromise(wx.chooseWXPay, config).then(res => {
-					resolve(res);
-				}).catch(res => {
-					reject(res);
-				});
-			}).catch(res => {
-				reject(res);
-			});
-		});
-	}
-
-	toPromise(fn, config = {}) {
-		return new Promise((resolve, reject) => {
-			fn({
-				...config,
-				success(res) {
-					resolve(res);
-				},
-				fail(err) {
-					reject(err);
-				},
-				complete(err) {
-					reject(err);
-				},
-				cancel(err) {
-					reject(err);
-				}
-			});
-		});
-	}
-
-	/**
-	 * 自动去授权
-	 */
-	oAuth() {
-		if (uni.getStorageSync(WX_AUTH) && store.state.app.token) return;
-		const {
-			code
-		} = parseQuery();
-		if (!code) return this.toAuth();
-	}
-
-	clearAuthStatus() {
-
-	}
-
-	/**
-	 * 授权登陆获取token
-	 * @param {Object} code
-	 */
-	auth(code) {
-		return new Promise((resolve, reject) => {
-			let loginType = Cache.get(LOGINTYPE);
-			wechatAuth(code, parseInt(Cache.get("spread")), loginType)
-				.then(({
-					data
-				}) => {
-					let expires_time = data.expires_time.substring(0, 19);
-					expires_time = expires_time.replace(/-/g, '/');
-					expires_time = new Date(expires_time).getTime();
-					let newTime = Math.round(new Date() / 1000);
-					store.commit("LOGIN", {
-						token: data.token,
-						time: expires_time - newTime
-					});
-					Cache.set(WX_AUTH, code);
-					Cache.clear(STATE_KEY);
-					loginType && Cache.clear(LOGINTYPE);
-					resolve();
-				})
-				.catch(reject);
-		});
-	}
-
-	/**
-	 * 获取跳转授权后的地址
-	 * @param {Object} appId
-	 */
-	getAuthUrl(appId) {
-		const redirect_uri = encodeURIComponent(
-			`${location.origin}/pages/auth/index?back_url=` +
-			encodeURIComponent(
-				encodeURIComponent(
-					uni.getStorageSync(BACK_URL) ?
-					uni.getStorageSync(BACK_URL) :
-					location.pathname + location.search
-				)
-			)
-		);
-		uni.removeStorageSync(BACK_URL);
-		const state = encodeURIComponent(
-			("" + Math.random()).split(".")[1] + "authorizestate"
-		);
-		uni.setStorageSync(STATE_KEY, state);
-		return `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${appId}&redirect_uri=${redirect_uri}&response_type=code&scope=snsapi_userinfo&state=${state}#wechat_redirect`;
-	}
-
-	/**
-	 * 跳转自动登陆
-	 */
-	toAuth() {
-		let that = this;
-		this.wechat().then(wx => {
-			location.href = this.getAuthUrl(that.initConfig.appId);
-		})
-	}
-
-	/**
-	 * 绑定事件
-	 * @param {Object} name 事件名
-	 * @param {Object} config 参数
-	 */
-	wechatEvevt(name, config) {
-		let that = this;
-		return new Promise((resolve, reject) => {
-			let configDefault = {
-				fail(res) {
-					console.log(res,11111);
-					if (that.instance) return reject({
-						is_ready: true,
-						wx: that.instance
-					});
-					that.verifyInstance().then(wx => {
-						return reject({
-							is_ready: true,
-							wx: wx
-						});
-					})
-				},
-				success(res) {
-					return resolve(res,2222);
-				}
-			};
-			Object.assign(configDefault, config);
-			that.wechat().then(wx => {
-				if (typeof name === 'object') {
-					name.forEach(item => {
-						wx[item] && wx[item](configDefault)
-					})
-				} else {
-					wx[name] && wx[name](configDefault)
-				}
-			})
-		});
-	}
-
-	isWeixin() {
-		return navigator.userAgent.toLowerCase().indexOf("micromessenger") !== -1;
-	}
-
-}
-
-export default new AuthWechat();
-

+ 64 - 49
pages.json

@@ -219,53 +219,60 @@
 				"navigationBarBackgroundColor": "#051137",
 				"navigationBarTextStyle": "white"
 			}
-		},
-		{
-			"path": "pages/user/money",
-			"style": {
-				"navigationBarTitleText": "USTD",
-				"enablePullDownRefresh": false,
-				"navigationBarBackgroundColor": "#051137",
-				"navigationBarTextStyle": "white"
-			}
-		},
-		{
-			"path": "pages/user/transfer",
-			"style": {
-				"navigationBarTitleText": "转账",
-				"enablePullDownRefresh": false,
-				"navigationBarBackgroundColor": "#051137",
-				"navigationBarTextStyle": "white"
-			}
-		},
-		{
-			"path": "pages/user/collection",
-			"style": {
-				"navigationBarTitleText": "收款",
-				"enablePullDownRefresh": false,
-				"navigationBarBackgroundColor": "#051137",
-				"navigationBarTextStyle": "white"
-			}
-		},
-		{
-			"path": "pages/user/withdrawal",
-			"style": {
-				"navigationBarTitleText": "提币",
-				"enablePullDownRefresh": false,
-				"navigationBarBackgroundColor": "#051137",
-				"navigationBarTextStyle": "white"
-			}
 		}
 	],
 	"subPackages": [{ // 模块分包
 		"root": "pages/user",
 		"name": "shop",
-		"pages": [{
+		"pages": [
+			{
+				"path": "set/team",
+				"style": {
+					"navigationBarTitleText": "我的推广",
+					"navigationBarBackgroundColor": "#051137",
+					"navigationBarTextStyle": "white"
+				}
+			},
+			{
+				"path": "set/bindBank",
+				"style": {
+					"navigationBarTitleText": "我的银行卡",
+					"navigationBarBackgroundColor": "#051137",
+					"navigationBarTextStyle": "white"
+				}
+			},
+			{
+				"path": "transfer",
+				"style": {
+					"navigationBarTitleText": "转账",
+					"enablePullDownRefresh": false,
+					"navigationBarBackgroundColor": "#051137",
+					"navigationBarTextStyle": "white"
+				}
+			},
+			{
+				"path": "collection",
+				"style": {
+					"navigationBarTitleText": "收款",
+					"enablePullDownRefresh": false,
+					"navigationBarBackgroundColor": "#051137",
+					"navigationBarTextStyle": "white"
+				}
+			},
+			{
+				"path": "withdrawal",
+				"style": {
+					"navigationBarTitleText": "提币",
+					"enablePullDownRefresh": false,
+					"navigationBarBackgroundColor": "#051137",
+					"navigationBarTextStyle": "white"
+				}
+			},{
 				"path": "money/recharge",
 				"style": {
 					"navigationBarTitleText": "充值",
 					"enablePullDownRefresh": false,
-					"navigationBarBackgroundColor": "#000000",
+					"navigationBarBackgroundColor": "#051137",
 					"navigationBarTextStyle": "white"
 				}
 			},
@@ -273,7 +280,15 @@
 				"path": "money/withdrawal",
 				"style": {
 					"navigationBarTitleText": "奖励提现",
-					"navigationBarBackgroundColor": "#000000",
+					"navigationBarBackgroundColor": "#051137",
+					"navigationBarTextStyle": "white"
+				}
+			},
+			{
+				"path": "money",
+				"style": {
+					"navigationBarTitleText": "记录",
+					"navigationBarBackgroundColor": "#051137",
 					"navigationBarTextStyle": "white"
 				}
 			},
@@ -288,7 +303,7 @@
 				"path": "set/set",
 				"style": {
 					"navigationBarTitleText": "设置",
-					"navigationBarBackgroundColor": "#000000",
+					"navigationBarBackgroundColor": "#051137",
 					"navigationBarTextStyle": "white"
 				}
 			}, {
@@ -296,7 +311,7 @@
 				"style": {
 					"navigationBarTitleText": "交易密码",
 					"enablePullDownRefresh": false,
-					"navigationBarBackgroundColor": "#000000",
+					"navigationBarBackgroundColor": "#051137",
 					"navigationBarTextStyle": "white"
 				}
 
@@ -305,7 +320,7 @@
 				"path": "set/password",
 				"style": {
 					"navigationBarTitleText": "修改密码",
-					"navigationBarBackgroundColor": "#000000",
+					"navigationBarBackgroundColor": "#051137",
 					"navigationBarTextStyle": "white"
 				}
 			},
@@ -313,7 +328,7 @@
 				"path": "set/userinfo",
 				"style": {
 					"navigationBarTitleText": "修改资料",
-					"navigationBarBackgroundColor": "#000000",
+					"navigationBarBackgroundColor": "#051137",
 					"navigationBarTextStyle": "white"
 				}
 			},
@@ -322,7 +337,7 @@
 				"style": {
 					"navigationBarTitleText": "会员列表",
 					"enablePullDownRefresh": false,
-					"navigationBarBackgroundColor": "#000000",
+					"navigationBarBackgroundColor": "#051137",
 					"navigationBarTextStyle": "white"
 				}
 			},
@@ -331,15 +346,15 @@
 				"style": {
 					"navigationBarTitleText": "他的粉絲",
 					"enablePullDownRefresh": false,
-					"navigationBarBackgroundColor": "#000000",
+					"navigationBarBackgroundColor": "#051137",
 					"navigationBarTextStyle": "white"
 				}
 			},
 			{
-				"path": "shareQrCode",
+				"path": "set/shareQrCode",
 				"style": {
-					"navigationBarTitleText": "互娛記錄",
-					"navigationBarBackgroundColor": "#000000",
+					"navigationBarTitleText": "推广码",
+					"navigationBarBackgroundColor": "#051137",
 					"navigationBarTextStyle": "white"
 				}
 			},
@@ -347,7 +362,7 @@
 				"path": "favorites",
 				"style": {
 					"navigationBarTitleText": "推廣海報",
-					"navigationBarBackgroundColor": "#000000",
+					"navigationBarBackgroundColor": "#051137",
 					"navigationBarTextStyle": "white"
 				}
 			}

+ 10 - 8
pages/index/index.vue

@@ -1,7 +1,7 @@
 <template>
 	<view class="container">
 		<view class="top flex">
-			<view class="icon1 flex">
+			<view class="icon1 flex" @click="openurl('/pages/user/set/set')">
 				<image src="/static/image/img01.png" style="width: 139rpx;" mode="widthFix"></image>
 				<view class="myName">我的</view>
 			</view>
@@ -29,11 +29,11 @@
 				<image src="/static/image/img07.png" style="width: 123rpx;" mode="widthFix"></image>
 				<view class="navName">实名认证</view>
 			</view>
-			<view class="navTpl" @click="openurl('/pages/index/transaction')">
+			<view class="navTpl" @click="openurl('/pages/user/set/transaction')">
 				<image src="/static/image/img08.png" style="width: 123rpx;" mode="widthFix"></image>
 				<view class="navName">交易密码</view>
 			</view>
-			<view class="navTpl" @click="openurl('/pages/index/information')">
+			<view class="navTpl" @click="openurl('/pages/user/collection')">
 				<image src="/static/image/img09.png" style="width: 123rpx;" mode="widthFix"></image>
 				<view class="navName">收款信息</view>
 			</view>
@@ -59,10 +59,10 @@
 			</view>
 		</view>
 		<image src="/static/image/img11.png" style="width: 692rpx;padding-top: 31rpx;" mode="widthFix"></image>
-		<view class="titleBox">
+		<!-- <view class="titleBox">
 			<view class="titleTip">累计成交量</view>
-		</view>
-		<view class="flex totalBox">
+		</view> -->
+		<!-- <view class="flex totalBox">
 			<view class="totalTpl">
 				<view class="totalNum">10,910,000<text>USDT</text></view>
 				<view class="totalName">累计买入</view>
@@ -71,7 +71,7 @@
 				<view class="totalNum">10,910,000<text>USDT</text></view>
 				<view class="totalName">累计卖出</view>
 			</view>
-		</view>
+		</view> -->
 		<view class="titleBox">
 			<view class="titleTip">平台优势</view>
 		</view>
@@ -189,7 +189,9 @@
 			}),
 			openurl(url){
 				if(!this.hasLogin){
-					return 
+					saveUrl();
+					interceptor();
+					return
 				}
 				uni.navigateTo({
 					url: url,

+ 0 - 6
pages/index/information.vue

@@ -44,15 +44,9 @@
 	</view>
 </template>
 <script type="text/javascript">
-import uniList from '@/components/uni-list/uni-list.vue';
-import uniListItem from '@/components/uni-list-item/uni-list-item.vue';
 // import { show_cb,do_cb } from '@/api/recharge.js';
 // import { upload } from '@/api/real.js';
 export default {
-	components: {
-		uniList,
-		uniListItem
-	},
 	data() {
 		return {
 			uid: '',

+ 61 - 43
pages/index/order.vue

@@ -3,12 +3,12 @@
 		<view class="fixedBox">
 			<view class="navList flex">
 				<view v-for="(item, index) in navItem" :key="index" class="navItem"
-					:class="{ activeItem: tabIndex === index,tip:index == 0 }" @click="tabClick(index,0,1)">{{ item }}
+					:class="{ activeItem: tabIndex === index,tip:index == 0 }" @click="tabClick(index,1)">{{ item }}
 				</view>
 			</view>
 			<view class="navList flex navList2">
 				<view v-for="(item, index) in navList[tabIndex]" :key="index" class="navItem"
-					:class="{ activeItem: tabCurr === index}" @click="tabClick(index,item.status,2)">{{ item.name }}
+					:class="{ activeItem: tabCurr === index}" @click="tabClick(index,2)">{{ item.name }}
 				</view>
 			</view>
 		</view>
@@ -40,7 +40,8 @@
 
 <script>
 	import {
-		registerVerify
+		sellMy,
+		sellBuyMy
 	} from '@/api/game.js';
 	import {
 		mapState
@@ -51,40 +52,40 @@
 		},
 		data() {
 			return {
-				tabIndex: 0,//当前选中的一级分类
+				tabIndex: 0, //当前选中的一级分类
 				navItem: ['卖币订单', '买币订单'],
-				tabCurr: 0,//当前选中的二级分类
+				tabCurr: 0, //当前选中的二级分类
 				status: 0, //当前选中状态
 				navList: [
-					[{
-						name: '全部',
-						status: 0
-					}, {
-						name: '挂单中',
+					[ {
+						name: '挂出',
 						status: 1
 					}, {
-						name: '已售罄',
-						status: 2
-					}, {
-						name: '已下架',
+						name: '待确认',
 						status: 3
-					}],
-					[{
-						name: '全部',
+					}, {
+						name: '完成',
+						status: 2
+					},{
+						name: '结束',
 						status: 0
+					},],
+					[ {
+						name: '待上传',
+						status: 3
 					}, {
-						name: '进行中',
-						status: 1
+						name: '已上传',
+						status: 5
 					}, {
-						name: '完成',
+						name: '完成',
 						status: 2
-					}, {
-						name: '已取消',
-						status: 3
-					}]
+					},{
+						name: '结束',
+						status: 0
+					},]
 				],
 				page: 1,
-				limit:10,
+				limit: 10,
 				loadingType: "more",
 				list: []
 			}
@@ -103,35 +104,52 @@
 					return;
 				}
 				obj.loadingType = "loading";
-				registerVerify({
-					page: obj.page,
-					limit: 10
-				}, obj.status).then(res => {
-					if (res.length > 0) {
-						obj.list = obj.list.concat(res);
-						obj.page++;
-						if (obj.limit == res.length) {
-							obj.loadingType = "more";
-						} else {
-							obj.loadingType = "nomore";
-						}
+
+				if (this.tabIndex == 0) {
+					sellMy({
+						page: obj.page,
+						limit: 10,
+						status:obj.status
+					}, obj.status).then(res => {
+						obj.dataList(res.data.list)
+					});
+				} else if (this.tabIndex == 1) {
+					sellBuyMy({
+						page: obj.page,
+						limit: 10,
+						status:obj.status
+					}, obj.status).then(res => {
+						obj.dataList(res.data.list)
+					});
+				}
+			},
+			dataList(ar) {
+				const obj = this;
+				if (ar.length > 0) {
+					obj.list = obj.list.concat(ar);
+					obj.page++;
+					if (obj.limit == ar.length) {
+						obj.loadingType = "more";
+					} else {
+						obj.loadingType = "nomore";
 					}
-				});
+				}
+				console.log(obj.list,"list");
 			},
-			tabClick(index, status, type) {
+			tabClick(index,type) {
 				if (type == 1) {
-					if(index ==this.tabIndex ){
+					if (index == this.tabIndex) {
 						return
 					}
 					this.tabIndex = index;
 					this.tabCurr = 0
-				} else if(type==2) {
-					if(index ==this.tabCurr ){
+				} else if (type == 2) {
+					if (index == this.tabCurr) {
 						return
 					}
 					this.tabCurr = index
-					this.status = status
 				}
+				this.status = this.navList[this.tabIndex][this.tabCurr].status;
 				this.page = 1;
 				this.loadingType = "more";
 				this.list = []

+ 74 - 8
pages/index/pledge.vue

@@ -12,13 +12,13 @@
 					<input type="number" class="inputBox" v-model="number" placeholder="请输入数量" />
 					<view class="flex_item">
 						<view class="listTip">USDT</view>
-						<view class="listAll">全部</view>
+						<view class="listAll" @click="number=money">全部</view>
 					</view>
 
 				</view>
 				<view class="flex tipBox">
-					<view class="tip1">可用余额2.12USDT</view>
-					<view class="tip1">限额10个</view>
+					<view class="tip1">可用余额{{money}}USDT</view>
+					<view class="tip1">限额{{baseData.min_sell}}到{{baseData.max_sell}}个</view>
 				</view>
 			</view>
 			<view class="listBox" style="padding-top: 0rpx;">
@@ -32,7 +32,7 @@
 			<view class="submission">
 				<button class="golden" type="golden" hover-class="none" @click="submission">一键卖币</button>
 			</view>
-			<view class="tips">*参考汇率7:23</view>
+			<view class="tips">*参考汇率{{baseData.us_price}}</view>
 		</view>
 		<view class="listItemBox" v-if="tabCurrentIndex == 1">
 			<view class="listItem" v-for="item,index in list" :key="index">
@@ -49,7 +49,7 @@
 						<view class="tipText">数量:{{item.num}}</view>
 						<view class="tipText">{{item.add_time|dateFormat}}</view>
 					</view>
-					<view class="tipBtn">买入</view>
+					<view class="tipBtn" @click="commitorder(item)">买入</view>
 				</view>
 			</view>
 			<uni-load-more :status="loadingType"></uni-load-more>
@@ -60,11 +60,18 @@
 <script>
 	import {
 		getsell,
-		sellPush
+		sellPush,
+		sellBuy
 	} from '@/api/game.js';
+	import {
+		getIndex
+	} from '@/api/index.js';
 	import {
 		mapState
 	} from 'vuex';
+	import {
+		qianBao
+	} from '@/api/wallet.js';
 	import dayjs from '@/libs/dayjs/dayjs.min.js';
 	export default {
 		computed: {
@@ -84,7 +91,12 @@
 				page: 1,
 				limit: 10,
 				list: [],
-				loadingType: 'more'
+				loadingType: 'more',
+				baseData:{
+					min_sell:'',
+					max_sell:''
+				},
+				loaded:false,
 			}
 		},
 		onNavigationBarButtonTap(res) {
@@ -95,7 +107,60 @@
 		onShow() {
 			this.init();
 		},
+		onLoad() {
+			this.getIndex()
+		},
 		methods: {
+			qianBao() {
+				const that = this;
+				qianBao().then((res) => {
+					that.money = +res.data.like_usdt;
+				})
+			},
+			getIndex(){
+				getIndex({})
+					.then(({
+						data
+					}) => {
+						this.baseData = data
+						console.log(data);
+					})
+					.catch(e => {});
+			},
+			// 购买订单
+			commitorder(item) {
+				uni.showModal({
+					title: '请输入支付密码',
+					editable:true,
+					success: res => {
+						if (res.confirm) {
+							if (res.content) {
+								uni.showLoading({
+									title: '支付中。。。',
+									mask: true
+								});
+								sellBuy({
+										id: item.id,
+										trade_psw: res.content,
+									}).then((
+										data
+									) => {
+										uni.hideLoading();
+										uni.showModal({
+											title: '提示',
+											content: data.msg,
+											showCancel: false,
+										});
+									})
+									.catch(e => {
+										uni.hideLoading()
+										console.log(e);
+									});
+							}
+						}
+					},
+				});
+			},
 			// 挂出
 			submission() {
 				sellPush({
@@ -120,6 +185,7 @@
 				this.list = [];
 				this.loadingType = 'more';
 				this.loadData();
+				this.qianBao();
 			},
 			tabClick(index) {
 				this.tabCurrentIndex = index;
@@ -167,7 +233,7 @@
 							navItem.loadingType = 'noMore';
 						}
 						uni.hideLoading();
-						that.$set(navItem, 'loaded', true);
+						that.loaded = true;
 					})
 					.catch(e => {
 						console.log(e);

+ 304 - 218
pages/index/recharge.vue

@@ -8,35 +8,50 @@
 			<view class="infoBox">
 				<view class="tplName">链名称</view>
 				<view class="tplNum">USDT-TRC20</view>
-				<view class="tplAddr">收款地址<text>ca87ca68ca68c6a986c98a678c7a8</text></view>
+				<view class="tplAddr">收款地址<text>{{dataMoney.address}}</text></view>
+			</view>
+			<view class="code">
+				<image :src="er_code" mode=""></image>
+				<!-- #ifdef H5 || APP-PLUS -->
+				<zb-code ref="qrcode" :show="codeShow" :cid="cid" :val="val" :size="size" :unit="unit"
+					:background="background" :foreground="foreground" :pdground="pdground" :icon="codeIcon"
+					:iconSize="iconsize" :onval="onval" :loadMake="loadMake" @result="qrR" />
+				<!-- #endif -->
 			</view>
-			<view class="code"><image :src="er_code"></image></view>
 			<view class="flex btnBox">
-				<view class="btn">保存相册</view>
-				<view class="btn">复制地址</view>
+				<!-- #ifdef APP -->
+				<view class="btn margin-r-30" @click="domImage">保存相册</view>
+				<!-- #endif -->
+				<view class="btn" @click="copy">复制地址</view>
 			</view>
 		</view>
 		<view class="login_text">
 			<view class="login_input flex" style="padding-top: 45rpx;">
 				<view class="login_img">金额</view>
-				<view class="login_name"><input class="uni-input" type="text" v-model="money" placeholder="请输入充值金额" /></view>
+				<view class="login_name"><input class="uni-input" type="text" v-model="money" placeholder="请输入充值金额" />
+				</view>
 			</view>
 			<view class="login_input flex">
 				<view class="login_img"><text>打款凭证</text></view>
-				<view class="login_name" @click="scImg"><image :src="img"></image></view>
+				<view class="login_name" @click="scImg">
+					<image :src="img"></image>
+				</view>
 			</view>
 			<view class="login_input flex" style="padding-top: 45rpx;border-bottom: none;">
 				<view class="login_img">备注</view>
-				<view class="login_name"><input class="uni-input" type="text" v-model="remark" placeholder="例如:备注用户账号" /></view>
+				<view class="login_name"><input class="uni-input" type="text" v-model="remark"
+						placeholder="例如:备注用户账号" /></view>
 			</view>
-			<view class="submission"><button class="golden" type="golden" hover-class="none" @click="submission">确认提交</button></view>
+			<view class="submission"><button class="golden" type="golden" hover-class="none"
+					@click="submission">确认提交</button></view>
 		</view>
 		<view class="login_text">
 			<view class="tip">
 				<view>
 					<text>
 						该地址仅支持 USDT-TRC20 收款请勿用于其他币种,否则资产将不可找回</br>
-						从易趣付之外地址转入的资金,需要在完成交易的120分钟后,才能将资产转账给易币付其他用户或提到钱包以外的地址 最小收款金额: 0.0001USDT小于最小金额的收款将不会上账且无法退回1次网络确认后可到账,1次网络确认后可转账。您的充值地址不会经常改变,可截图保存并重复充值。
+						从易趣付之外地址转入的资金,需要在完成交易的120分钟后,才能将资产转账给易币付其他用户或提到钱包以外的地址 最小收款金额:
+						0.0001USDT小于最小金额的收款将不会上账且无法退回1次网络确认后可到账,1次网络确认后可转账。您的充值地址不会经常改变,可截图保存并重复充值。
 					</text>
 				</view>
 			</view>
@@ -44,230 +59,301 @@
 	</view>
 </template>
 <script type="text/javascript">
-import uniList from '@/components/uni-list/uni-list.vue';
-import uniListItem from '@/components/uni-list-item/uni-list-item.vue';
-// import { show_cb,do_cb } from '@/api/recharge.js';
-// import { upload } from '@/api/real.js';
-export default {
-	components: {
-		uniList,
-		uniListItem
-	},
-	data() {
-		return {
-			uid: '',
-			list:'',
-			account: '',
-			money: '',
-			address:'',
-			er_code:'',
-			remark:'',
-			img: '/static/image/img19.png'
-		};
-	},
-	onLoad() {
-		this.uid = uni.getStorageSync('uid');
-		this.loadData();
-	},
-	methods: {
-		//获取数据
-		loadData() {
-		  // show_cb({})
-		  //   .then(data => {
-		  //     this.list = data.data;
-			 //  this.address = data.data.address;
-			 //  this.er_code = data.data.er_code;
-		  //   })
-		  //   .catch(err => {
-		  //     console.log(err);
-		  //   });
+	// import { show_cb,do_cb } from '@/api/recharge.js';
+	// import { upload } from '@/api/real.js';
+	import {
+		qianBao
+	} from '@/api/wallet.js';
+	import {
+		copyText
+	} from '@/utils/rocessor.js';
+	export default {
+		data() {
+			return {
+				uid: '',
+				list: '',
+				account: '',
+				money: '',
+				address: '',
+				er_code: '',
+				remark: '',
+				img: '/static/image/img19.png',
+				dataMoney: {},
+				uid: '',
+				account: '',
+				money: '',
+				address: '',
+				remark: '',
+				img: '/static/image/img19.png',
+				val: "", // 要生成的二维码值
+				size: 200, // 二维码大小
+				unit: 'upx', // 单位
+				background: '#FFF', // 背景色
+				foreground: '#000', // 前景色
+				pdground: '#000', // 角标色
+				icon: '', // 二维码图标
+				iconsize: 40, // 二维码图标大小
+				lv: 3, // 二维码容错级别 , 一般不用设置,默认就行
+				onval: true, // val值变化时自动重新生成二维码
+				loadMake: true, // 组件加载完成后自动生成二维码
+				src: '', // 二维码生成后的图片地址或base64
+				codeShow: false,
+				cid: '1',
+				codeIcon: '', // 二维码图标
+			};
 		},
-		//确认提交
-		submission() {
-			let obj = this;
-			uni.showLoading({
-				title: '充币中...',
-				mask: true
-			});
-			//确认充值调接口,成功跳转页面
-			do_cb({
-				uid: obj.uid,
-				img: obj.img,
-				address: obj.address,
-				money: obj.money,
-				bz: obj.remark,
-			})
-				.then(function(e) {
-					uni.showToast({
-						title: '请耐心等待系统审核通过',
-						duration: 1500,
-						mask: false,
-						icon: 'none'
-					});
-					uni.hideLoading();
+		onLoad() {
+			this.uid = uni.getStorageSync('uid');
+			this.qianBao();
+		},
+		methods: {
+			//获取数据
+			qianBao() {
+				const that = this;
+				qianBao({}).then(
+					(res) => {
+						that.dataMoney = res.data.back.USDT.money
+						that.val = that.dataMoney.address;
+						console.log(that.dataMoney, 'dataMoney');
+					}
+				).catch(
+					(res) => {
+						console.log(res,'err');
+					}
+				)
+			},
+			// 下载图片
+			domImage() {
+				uni.downloadFile({
+					url: this.er_code,
+					success(re) {
+						console.log(re.tempFilePath, 're');
+						uni.showToast({
+							title: '下载成功'
+						});
+					}
 				})
-				.catch(function(e) {
-					console.log(e);
+			},
+			// 复制地址
+			copy() {
+				copyText(this.dataMoney.address)
+			},
+			// 二维码生成
+			qrR(res) {
+				this.er_code = res;
+			},
+			//确认提交
+			submission() {
+				let obj = this;
+				uni.showLoading({
+					title: '充币中...',
+					mask: true
 				});
-		},
-		//上传图片
-		scImg() {
-			upload({
-				file:''
-			}).then((e) => {
-				console.log(e,55)
-				this.img = e[0].url;
-			});
-		},
-	}
-};
+				//确认充值调接口,成功跳转页面
+				do_cb({
+						uid: obj.uid,
+						img: obj.img,
+						address: obj.address,
+						money: obj.money,
+						bz: obj.remark,
+					})
+					.then(function(e) {
+						uni.showToast({
+							title: '请耐心等待系统审核通过',
+							duration: 1500,
+							mask: false,
+							icon: 'none'
+						});
+						uni.hideLoading();
+					})
+					.catch(function(e) {
+						console.log(e);
+					});
+			},
+			//上传图片
+			scImg() {
+				upload({
+					file: ''
+				}).then((e) => {
+					console.log(e, 55)
+					this.img = e[0].url;
+				});
+			},
+		}
+	};
 </script>
 
 <style lang="scss">
-/* page {
+	/* page {
 	min-height: 100%;
 	background: linear-gradient(-28deg, rgba(44, 45, 53, 1), rgba(59, 62, 74, 1));
 } */
-.body_content {
-	width: 100%;
-	height: 100%;
-}
-.login_text {
-	width: 100%;
-	color: #fff !important;
-	font-size: 28rpx !important;
-	background-color: #1F2A4A;
-	margin: 25rpx 0rpx;
-	padding: 0rpx 25rpx;
-	padding-bottom: 15rpx;
-}
-.recharge {
-	text-align: center;
-	color: #85858e;
-	font-size: 30rpx;
-	background-color: #1F2A4A;
-}
-.example-title{
-	text-align: left !important;
-	padding: 25rpx 25rpx;
-	border-bottom: 2rpx solid #2F364E;
-	color: #0C5AFA;
-	.titleTip{
-		width: 5rpx;
-		height: 30rpx;
-		background: linear-gradient(90deg, #0C5AFA, #1356FF);
-		border-radius: 3rpx;
-		margin-right: 15rpx;
+	.body_content {
+		width: 100%;
+		height: 100%;
 	}
-}
-.infoBox{
-	text-align: left;
-	padding: 28rpx 51rpx;
-	.tplName{
-		font-family: PingFang SC;
-		font-weight: bold;
-		font-size: 32rpx;
-		color: #FFFFFF;
-		line-height: 24rpx;
+
+	.login_text {
+		width: 100%;
+		color: #fff !important;
+		font-size: 28rpx !important;
+		background-color: #1F2A4A;
+		margin: 25rpx 0rpx;
+		padding: 0rpx 25rpx;
+		padding-bottom: 15rpx;
 	}
-	.tplNum{
-		margin: 30rpx 0rpx;
-		padding: 15rpx 30rpx;
-		border-radius: 10rpx;
-		border: 1px solid #1356FF;
-		font-family: PingFang SC;
-		font-size: 26rpx;
-		color: #1356FF;
-		display: inline-block;
+
+	.recharge {
+		text-align: center;
+		color: #85858e;
+		font-size: 30rpx;
+		background-color: #1F2A4A;
 	}
-	.tplAddr{
-		color: #fff;
-		font-size: 32rpx;
-		text{
-			padding-left: 15rpx;
-			font-size: 26rpx;
+
+	.example-title {
+		text-align: left !important;
+		padding: 25rpx 25rpx;
+		border-bottom: 2rpx solid #2F364E;
+		color: #0C5AFA;
+
+		.titleTip {
+			width: 5rpx;
+			height: 30rpx;
+			background: linear-gradient(90deg, #0C5AFA, #1356FF);
+			border-radius: 3rpx;
+			margin-right: 15rpx;
+		}
+	}
+
+	.infoBox {
+		text-align: left;
+		padding: 28rpx 51rpx;
+
+		.tplName {
+			font-family: PingFang SC;
+			font-weight: bold;
+			font-size: 32rpx;
 			color: #FFFFFF;
+			line-height: 24rpx;
+		}
+
+		.tplNum {
+			margin: 30rpx 0rpx;
+			padding: 15rpx 30rpx;
+			border-radius: 10rpx;
+			border: 1px solid #1356FF;
+			font-family: PingFang SC;
+			font-size: 26rpx;
+			color: #1356FF;
+			display: inline-block;
+		}
+
+		.tplAddr {
+			color: #fff;
+			font-size: 32rpx;
+
+			text {
+				padding-left: 15rpx;
+				font-size: 26rpx;
+				color: #FFFFFF;
+			}
 		}
 	}
-}
-.login_input {
-	border-bottom: 1px solid #464755;
-	padding: 35rpx;
-}
-.uni-input {
-	width: 100%;
-	text-align: left !important;
-}
-.code {
-	width: 277rpx;
-	height: 277rpx;
-	margin: 25rpx auto;
-	margin-bottom: 35rpx;
-	background: #0C5AFA;
-}
-.code image {
-	width: 100%;
-	height: 100%;
-}
-.btnBox{
-	justify-content: center;
-	padding-bottom: 50rpx;
-	padding-top: 30rpx;
-	.btn{
-		margin-right: 50rpx;
-		font-family: PingFang SC;
-		font-weight: bold;
-		font-size: 26rpx;
-		color: #0C5AFA;
-		border: 1rpx solid #0C5AFA;
-		padding: 15rpx 45rpx;
-		border-radius: 15rpx;
+
+	.login_input {
+		border-bottom: 1px solid #464755;
+		padding: 35rpx;
+	}
+
+	.uni-input {
+		width: 100%;
+		text-align: left !important;
 	}
-}
-.submission {
-	padding: 30rpx 25rpx;
-	.golden{
+
+	.code {
+		width: 277rpx;
+		height: 277rpx;
+		margin: 25rpx auto;
+		margin-bottom: 35rpx;
 		background: #0C5AFA;
-		color: #fff;
 	}
-}
-.login_name {
-	width: 480rpx;
-	color: #ffffff;
-}
-.login_name image {
-	width: 100rpx;
-	height: 100rpx;
-}
-.tip {
-	padding: 29rpx 31rpx;
-	line-height: 55rpx;
-	font-size: 24rpx;
-}
-.select_img {
-	width: 28rpx;
-	height: 32rpx;
-}
-.select_img image {
-	width: 100%;
-	height: 100%;
-}
-.scann {
-	margin-bottom: 35rpx;
-	margin-top: 15rpx;
-}
-.scanning {
-	background-color: #6f6f78;
-	color: #ffffff;
-	padding: 10rpx 30rpx;
-	border-radius: 15rpx;
-	font-size: 28rpx;
-}
-.address_code {
-	padding: 25rpx 0rpx;
-	color: #ffffff;
-}
-.input-placeholder{
-	color: #fff !important;
-}
-</style>
+
+	.code image {
+		width: 100%;
+		height: 100%;
+	}
+
+	.btnBox {
+		justify-content: center;
+		padding-bottom: 50rpx;
+		padding-top: 30rpx;
+
+		.btn {
+			margin-right: 50rpx;
+			font-family: PingFang SC;
+			font-weight: bold;
+			font-size: 26rpx;
+			color: #0C5AFA;
+			border: 1rpx solid #0C5AFA;
+			padding: 15rpx 45rpx;
+			border-radius: 15rpx;
+		}
+	}
+
+	.submission {
+		padding: 30rpx 25rpx;
+
+		.golden {
+			background: #0C5AFA;
+			color: #fff;
+		}
+	}
+
+	.login_name {
+		width: 480rpx;
+		color: #ffffff;
+	}
+
+	.login_name image {
+		width: 100rpx;
+		height: 100rpx;
+	}
+
+	.tip {
+		padding: 29rpx 31rpx;
+		line-height: 55rpx;
+		font-size: 24rpx;
+	}
+
+	.select_img {
+		width: 28rpx;
+		height: 32rpx;
+	}
+
+	.select_img image {
+		width: 100%;
+		height: 100%;
+	}
+
+	.scann {
+		margin-bottom: 35rpx;
+		margin-top: 15rpx;
+	}
+
+	.scanning {
+		background-color: #6f6f78;
+		color: #ffffff;
+		padding: 10rpx 30rpx;
+		border-radius: 15rpx;
+		font-size: 28rpx;
+	}
+
+	.address_code {
+		padding: 25rpx 0rpx;
+		color: #ffffff;
+	}
+
+	.input-placeholder {
+		color: #fff !important;
+	}
+</style>

+ 86 - 83
pages/index/user.vue

@@ -2,7 +2,7 @@
 	<view class="container">
 		<view class="topBox">
 			<view class="topName">我的资产</view>
-			<view class="topMoney">$3000</view>
+			<view class="topMoney">${{money}}</view>
 			<view class="flex topInfo">
 				<view class="flex_item infoTpl" @click="navTo('/pages/user/transfer')">
 					<image src="/static/image/img27.png" style="width: 48rpx;" mode="widthFix"></image>
@@ -18,21 +18,21 @@
 				</view>
 			</view>
 			<view class="flex_item moneyBox">
-				<image src="/static/image/img26.png" style="width: 30rpx" mode="widthFix"></image>
+				<image src="/static/image/img26.png" style="width: 30rpx;height:30rpx" mode="scaleToFill"></image>
 				<view class="moneyName">资产正在保护中</view>
 			</view>
 		</view>
 		<view class="listBox">
 			<view class="listName">我的资产</view>
-			<view class="flex listTpl" @click="navTo('/pages/user/money')">
+			<view class="flex listTpl" v-for="(item) in list" @click="navTo(`/pages/user/money?type=${item.name}`)">
 				<view class="flex_item TplInfo">
-					<image src="/static/image/img30.png" style="width: 80rpx;" mode="widthFix"></image>
-					<view class="infoName">USDT</view>
+					<image :src="item.LOGO" class="typeLogo" mode="scaleToFill"></image>
+					<view class="infoName">{{item.name}}</view>
 				</view>
 				<view class="flex_item tplTip">
 					<view class="tipBox">
-						<view>0.0000</view>
-						<view class="tip">≈0.00RMB</view>
+						<view>{{item.money.money*1}}</view>
+						<view class="tip">≈{{item.rmb*1}}RMB</view>
 					</view>
 					<image src="/static/image/img31.png" style="width: 18rpx;" mode="widthFix"></image>
 				</view>
@@ -45,29 +45,35 @@
 	// 	getIndex,
 	// } from "@/api/index.js";
 
-	// import {
-	// 	gameWallet,
-	// } from "@/api/game.js";
-	import { mapState,mapMutations } from 'vuex';
-	// import {
-	// 	getUserInfo,
-	// 	getUser
-	// } from '@/api/user.js';
+	import {
+		mapState,
+		mapMutations
+	} from 'vuex';
+	import {
+		getUserInfo,
+		getUser
+	} from '@/api/user.js';
+	import {
+		qianBao
+	} from '@/api/wallet.js';
 	import {
 		saveUrl,
 		interceptor
 	} from '@/utils/loginUtils.js';
 	export default {
 		data() {
-			return {};
+			return {
+				dataMoney: {},
+				money: '',
+				list: {}
+			};
 		},
 		onShow() {
 			// 判断是否已经登录
 			if (this.hasLogin) {
-				// this.getUserWallet();
-				// this.getUser();
+				this.loadBaseData();
+				this.getUserWallet();
 			}
-			// this.loadBaseData();
 			// this.getIndex()
 		},
 		computed: {
@@ -76,65 +82,44 @@
 		},
 		methods: {
 			...mapMutations('user', ['setUserInfo']),
-			// copyShareLink() {
-			// 	if (!this.hasLogin) {
-			// 		// 保存地址
-			// 		saveUrl();
-			// 		// 登录拦截
-			// 		interceptor();
-			// 	} else {
-			// 		uni.setClipboardData({
-			// 			data: this.baseURL + this.urlFile + '/#/pages/index/index?spread=' + this.user.account,
-			// 			success: function() {
-			// 				//调用方法成功
-			// 				console.log("success");
-			// 			},
-			// 		});
-			// 	}
-			// },
 			// 获取用户余额信息
 			getUserWallet() {
-				// gameWallet().then((res) => {
-				// 	const balance = Number(res.data.back.USDT.money.money);
-				// 	this.userWallet = +balance.toFixed(2);
-				// 	this.userWalletRmb = Number(res.data.back.USDT.rmb);
-				// 	this.userPKR = Number(res.data.back.PKR.money.money);
-				// 	this.userPKRRmb = Number(res.data.back.PKR.rmb);
-				// 	// this.userWallet = +res.data.back.USDT.money.money
-				// })
+				const that = this;
+				qianBao().then((res) => {
+					that.dataMoney = res.data.back.USDT.money;
+					that.money = +res.data.like_usdt;
+					that.list = res.data.back;
+				})
 			},
 			// 加载初始数据
 			loadBaseData() {
 				const obj = this
-				// getUserInfo({})
-				// 	.then(({
-				// 		data
-				// 	}) => {
-				// 		obj.setUserInfo(data);
-
-				// 	})
-				// 	.catch(e => {
-				// 		console.log(e);
-				// 	});
+				getUserInfo({})
+					.then(({
+						data
+					}) => {
+						obj.setUserInfo(data);
+
+					})
+					.catch(e => {
+						console.log(e);
+					});
 			},
 			/**
 			 * 统一跳转接口,拦截未登录路由
 			 * navigator标签现在默认没有转场动画,所以用view
 			 */
 			navTo(url) {
-				// if (!this.hasLogin) {
-				// 	// 保存地址
-				// 	saveUrl();
-				// 	// 登录拦截
-				// 	interceptor();
-				// } else {
-				// 	uni.navigateTo({
-				// 		url
-				// 	});
-				// }
-				uni.navigateTo({
-					url
-				});
+				if (!this.hasLogin) {
+					// 保存地址
+					saveUrl();
+					// 登录拦截
+					interceptor();
+				} else {
+					uni.navigateTo({
+						url
+					});
+				}
 			},
 		}
 	};
@@ -143,33 +128,44 @@
 	.container {
 		padding: 25rpx 25rpx;
 	}
-    .topBox{
+
+	.typeLogo {
+		height: 80rpx;
+		width: 80rpx;
+	}
+
+	.topBox {
 		width: 100%;
 		background: #1F2A4A;
 		border-radius: 15rpx;
 		padding: 40rpx 45rpx;
 		position: relative;
-		.topName{
+
+		.topName {
 			font-weight: bold;
 			font-size: 27rpx;
 			color: #FFFFFF;
 		}
-		.topMoney{
+
+		.topMoney {
 			font-weight: bold;
 			font-size: 60rpx;
 			color: #FFFFFF;
 			padding: 65rpx 0rpx;
 		}
-		.topInfo{
+
+		.topInfo {
 			font-size: 27rpx;
 			color: #FFFFFF;
-			.infoTpl{
-				.tplName{
+
+			.infoTpl {
+				.tplName {
 					padding-left: 15rpx;
 				}
 			}
 		}
-		.moneyBox{
+
+		.moneyBox {
 			position: absolute;
 			right: 0;
 			top: 45rpx;
@@ -179,25 +175,30 @@
 			font-size: 24rpx;
 			color: #030E16;
 			padding: 8rpx 22rpx;
-			.moneyName{
+
+			.moneyName {
 				padding-left: 15rpx;
 			}
 		}
-		
+
 	}
-	.listBox{
+
+	.listBox {
 		padding: 50rpx 0rpx;
 		color: #FFFFFF;
-		.listName{
+
+		.listName {
 			font-family: PingFang SC;
 			font-weight: 500;
 			font-size: 36rpx;
 			color: #FFFFFF;
 		}
-		.listTpl{
+
+		.listTpl {
 			padding: 35rpx 0rpx;
-			.TplInfo{
-				.infoName{
+
+			.TplInfo {
+				.infoName {
 					font-family: PingFang SC;
 					font-weight: 500;
 					font-size: 32rpx;
@@ -205,14 +206,16 @@
 					padding-left: 31rpx;
 				}
 			}
-			.tplTip{
-				.tipBox{
+
+			.tplTip {
+				.tipBox {
 					padding-right: 30rpx;
 					font-family: PingFang SC;
 					font-weight: 500;
 					font-size: 32rpx;
 					color: #FFFFFF;
-					.tip{
+
+					.tip {
 						font-family: PingFang SC;
 						font-weight: 500;
 						font-size: 26rpx;

+ 4 - 4
pages/public/login.vue

@@ -1,7 +1,7 @@
 <template>
 	<view class="container">
 		<view class="container_text">
-			<image class="banner-img" src="/static/img/logo.png" mode="widthFix"></image>
+			<image class="banner-img" src="/static/img/logo.jpg" mode="widthFix"></image>
 		</view>
 		<view class="login_text">
 			<view class="login_input flex">
@@ -345,11 +345,11 @@
 		width: 100%;
 		height: 500rpx;
 		top: 0rpx;
-
+		text-align: center;
 		.banner-img {
-			width: 144rpx;
+			width: 200rpx;
 			margin-top: 100rpx;
-			margin-left: 302rpx;
+			border-radius: 100%;
 		}
 	}
 

+ 3 - 2
pages/public/register.vue

@@ -1,7 +1,7 @@
 <template>
 	<view class="container">
 		<view class="container_text">
-			<image class="banner-img" src="/static/img/logo.png" mode="widthFix"></image>
+			<image class="banner-img" src="/static/img/logo.jpg" mode="widthFix"></image>
 		</view>
 		<view class="login_text">
 			<view class="login_input flex">
@@ -265,8 +265,9 @@
 		width: 100%;
 		text-align: center;
 		.banner-img {
-			width: 144rpx;
+			width: 200rpx;
 			margin-top: 100rpx;
+			border-radius: 100%;
 		}
 	}
 

+ 257 - 234
pages/user/collection.vue

@@ -4,35 +4,30 @@
 			<view class="infoBox">
 				<view class="tplName">链名称</view>
 				<view class="tplNum">USDT-TRC20</view>
-				<view class="tplAddr">收款地址<text>ca87ca68ca68c6a986c98a678c7a8</text></view>
+				<view class="tplAddr">收款地址<text>{{val}}</text></view>
+			</view>
+			<view class="code">
+				<image :src="er_code" mode=""></image>
+				<!-- #ifdef H5 || APP-PLUS -->
+				<zb-code ref="qrcode" :show="codeShow" :cid="cid" :val="val" :size="size" :unit="unit"
+					:background="background" :foreground="foreground" :pdground="pdground" :icon="codeIcon"
+					:iconSize="iconsize" :onval="onval" :loadMake="loadMake" @result="qrR" />
+				<!-- #endif -->
 			</view>
-			<view class="code"><image :src="er_code"></image></view>
 			<view class="flex btnBox">
-				<view class="btn">保存相册</view>
-				<view class="btn">复制地址</view>
+				<!-- #ifdef APP -->
+				<view class="btn margin-r-30" @click="domImage">保存相册</view>
+				<!-- #endif -->
+				<view class="btn" @click="copy">复制地址</view>
 			</view>
 		</view>
-		<!-- <view class="login_text">
-			<view class="login_input flex" style="padding-top: 45rpx;">
-				<view class="login_img">金额</view>
-				<view class="login_name"><input class="uni-input" type="text" v-model="money" placeholder="请输入充值金额" /></view>
-			</view>
-			<view class="login_input flex">
-				<view class="login_img"><text>打款凭证</text></view>
-				<view class="login_name" @click="scImg"><image :src="img"></image></view>
-			</view>
-			<view class="login_input flex" style="padding-top: 45rpx;border-bottom: none;">
-				<view class="login_img">备注</view>
-				<view class="login_name"><input class="uni-input" type="text" v-model="remark" placeholder="例如:备注用户账号" /></view>
-			</view>
-			<view class="submission"><button class="golden" type="golden" hover-class="none" @click="submission">确认提交</button></view>
-		</view> -->
 		<view class="login_text">
 			<view class="tip">
 				<view>
 					<text>
 						该地址仅支持 USDT-TRC20 收款请勿用于其他币种,否则资产将不可找回</br>
-						从易趣付之外地址转入的资金,需要在完成交易的120分钟后,才能将资产转账给易币付其他用户或提到钱包以外的地址 最小收款金额: 0.0001USDT小于最小金额的收款将不会上账且无法退回1次网络确认后可到账,1次网络确认后可转账。您的充值地址不会经常改变,可截图保存并重复充值。
+						从易趣付之外地址转入的资金,需要在完成交易的120分钟后,才能将资产转账给易币付其他用户或提到钱包以外的地址 最小收款金额:
+						0.0001USDT小于最小金额的收款将不会上账且无法退回1次网络确认后可到账,1次网络确认后可转账。您的充值地址不会经常改变,可截图保存并重复充值。
 					</text>
 				</view>
 			</view>
@@ -40,235 +35,263 @@
 	</view>
 </template>
 <script type="text/javascript">
-import uniList from '@/components/uni-list/uni-list.vue';
-import uniListItem from '@/components/uni-list-item/uni-list-item.vue';
-// import { show_cb,do_cb } from '@/api/recharge.js';
-// import { upload } from '@/api/real.js';
-export default {
-	components: {
-		uniList,
-		uniListItem
-	},
-	data() {
-		return {
-			uid: '',
-			list:'',
-			account: '',
-			money: '',
-			address:'',
-			er_code:'',
-			remark:'',
-			img: '/static/image/img19.png'
-		};
-	},
-	onLoad() {
-		this.uid = uni.getStorageSync('uid');
-		this.loadData();
-	},
-	methods: {
-		//获取数据
-		loadData() {
-		  // show_cb({})
-		  //   .then(data => {
-		  //     this.list = data.data;
-			 //  this.address = data.data.address;
-			 //  this.er_code = data.data.er_code;
-		  //   })
-		  //   .catch(err => {
-		  //     console.log(err);
-		  //   });
+	import {
+		copyText
+	} from '@/utils/rocessor.js';
+	import {
+		mapState,
+	} from 'vuex';
+	export default {
+		data() {
+			return {
+				dataMoney: {},
+				list: '',
+				account: '',
+				money: '',
+				address: '',
+				er_code: '23456',
+				remark: '',
+				img: '/static/image/img19.png',
+				val: "", // 要生成的二维码值
+				size: 200, // 二维码大小
+				unit: 'upx', // 单位
+				background: '#FFF', // 背景色
+				foreground: '#000', // 前景色
+				pdground: '#000', // 角标色
+				icon: '', // 二维码图标
+				iconsize: 40, // 二维码图标大小
+				lv: 3, // 二维码容错级别 , 一般不用设置,默认就行
+				onval: true, // val值变化时自动重新生成二维码
+				loadMake: true, // 组件加载完成后自动生成二维码
+				src: '', // 二维码生成后的图片地址或base64
+				codeShow: false,
+				cid: '1',
+				codeIcon: '', // 二维码图标
+			};
 		},
-		//确认提交
-		submission() {
-			let obj = this;
-			uni.showLoading({
-				title: '充币中...',
-				mask: true
-			});
-			//确认充值调接口,成功跳转页面
-			do_cb({
-				uid: obj.uid,
-				img: obj.img,
-				address: obj.address,
-				money: obj.money,
-				bz: obj.remark,
-			})
-				.then(function(e) {
-					uni.showToast({
-						title: '请耐心等待系统审核通过',
-						duration: 1500,
-						mask: false,
-						icon: 'none'
-					});
-					uni.hideLoading();
-				})
-				.catch(function(e) {
-					console.log(e);
-				});
+		onLoad() {
+			this.val = this.userInfo.uid;
+			console.log(this.userInfo,'this.userInfo');
 		},
-		//上传图片
-		scImg() {
-			upload({
-				file:''
-			}).then((e) => {
-				console.log(e,55)
-				this.img = e[0].url;
-			});
+		computed: {
+			...mapState('user', ['userInfo']),
 		},
-	}
-};
+		methods: {
+			// 下载图片
+			domImage(){
+				uni.downloadFile({
+					url:this.er_code,
+					success(re){
+						console.log(re.tempFilePath,'re');
+						uni.showToast({
+							title: '下载成功'
+						});
+					}
+				})
+			},
+			// 复制地址
+			copy(){
+				copyText(this.dataMoney.address)
+			},
+			// 二维码生成
+			qrR(res) {
+				this.er_code = res;
+			},
+			//获取数据
+			loadData() {
+				const that = this;
+				qianBao({}).then(
+					(res) => {
+						that.dataMoney = res.data.back.USDT.money
+						that.val = that.dataMoney.address;
+						console.log(that.dataMoney, 'dataMoney');
+					}
+				).catch(
+					(res) => {
+						console.log(res,'err');
+					}
+				)
+			},
+		}
+	};
 </script>
 
 <style lang="scss">
-/* page {
+	/* page {
 	min-height: 100%;
 	background: linear-gradient(-28deg, rgba(44, 45, 53, 1), rgba(59, 62, 74, 1));
 } */
-.container{
-	padding: 25rpx 25rpx;
-}
-.body_content {
-	width: 100%;
-	height: 100%;
-}
-.login_text {
-	width: 100%;
-	color: #fff !important;
-	font-size: 28rpx !important;
-	background-color: #1F2A4A;
-	margin: 25rpx 0rpx;
-	padding: 0rpx 25rpx;
-	padding-bottom: 15rpx;
-	border-radius: 25rpx;
-}
-.recharge {
-	text-align: center;
-	color: #85858e;
-	font-size: 30rpx;
-	border-radius: 25rpx;
-	background-color: #1F2A4A;
-}
-.example-title{
-	text-align: left !important;
-	padding: 25rpx 25rpx;
-	border-bottom: 2rpx solid #2F364E;
-	color: #0C5AFA;
-	.titleTip{
-		width: 5rpx;
-		height: 30rpx;
-		background: linear-gradient(90deg, #0C5AFA, #1356FF);
-		border-radius: 3rpx;
-		margin-right: 15rpx;
+	.container {
+		padding: 25rpx 25rpx;
 	}
-}
-.infoBox{
-	text-align: left;
-	padding: 28rpx 51rpx;
-	.tplName{
-		font-family: PingFang SC;
-		font-weight: bold;
-		font-size: 32rpx;
-		color: #FFFFFF;
-		line-height: 24rpx;
+
+	.body_content {
+		width: 100%;
+		height: 100%;
 	}
-	.tplNum{
-		margin: 30rpx 0rpx;
-		padding: 15rpx 30rpx;
-		border-radius: 10rpx;
-		border: 1px solid #1356FF;
-		font-family: PingFang SC;
-		font-size: 26rpx;
-		color: #1356FF;
-		display: inline-block;
+
+	.login_text {
+		width: 100%;
+		color: #fff !important;
+		font-size: 28rpx !important;
+		background-color: #1F2A4A;
+		margin: 25rpx 0rpx;
+		padding: 0rpx 25rpx;
+		padding-bottom: 15rpx;
+		border-radius: 25rpx;
 	}
-	.tplAddr{
-		color: #fff;
-		font-size: 32rpx;
-		text{
-			padding-left: 15rpx;
-			font-size: 26rpx;
+
+	.recharge {
+		text-align: center;
+		color: #85858e;
+		font-size: 30rpx;
+		border-radius: 25rpx;
+		background-color: #1F2A4A;
+	}
+
+	.example-title {
+		text-align: left !important;
+		padding: 25rpx 25rpx;
+		border-bottom: 2rpx solid #2F364E;
+		color: #0C5AFA;
+
+		.titleTip {
+			width: 5rpx;
+			height: 30rpx;
+			background: linear-gradient(90deg, #0C5AFA, #1356FF);
+			border-radius: 3rpx;
+			margin-right: 15rpx;
+		}
+	}
+
+	.infoBox {
+		text-align: left;
+		padding: 28rpx 51rpx;
+
+		.tplName {
+			font-family: PingFang SC;
+			font-weight: bold;
+			font-size: 32rpx;
 			color: #FFFFFF;
+			line-height: 24rpx;
+		}
+
+		.tplNum {
+			margin: 30rpx 0rpx;
+			padding: 15rpx 30rpx;
+			border-radius: 10rpx;
+			border: 1px solid #1356FF;
+			font-family: PingFang SC;
+			font-size: 26rpx;
+			color: #1356FF;
+			display: inline-block;
+		}
+
+		.tplAddr {
+			color: #fff;
+			font-size: 32rpx;
+
+			text {
+				padding-left: 15rpx;
+				font-size: 26rpx;
+				color: #FFFFFF;
+			}
 		}
 	}
-}
-.login_input {
-	border-bottom: 1px solid #464755;
-	padding: 35rpx;
-}
-.uni-input {
-	width: 100%;
-	text-align: left !important;
-}
-.code {
-	width: 277rpx;
-	height: 277rpx;
-	margin: 25rpx auto;
-	margin-bottom: 35rpx;
-	background: #0C5AFA;
-}
-.code image {
-	width: 100%;
-	height: 100%;
-}
-.btnBox{
-	justify-content: center;
-	padding-bottom: 50rpx;
-	padding-top: 30rpx;
-	.btn{
-		margin-right: 50rpx;
-		font-family: PingFang SC;
-		font-weight: bold;
-		font-size: 26rpx;
-		color: #0C5AFA;
-		border: 1rpx solid #0C5AFA;
-		padding: 15rpx 45rpx;
-		border-radius: 15rpx;
+
+	.login_input {
+		border-bottom: 1px solid #464755;
+		padding: 35rpx;
+	}
+
+	.uni-input {
+		width: 100%;
+		text-align: left !important;
 	}
-}
-.submission {
-	padding: 30rpx 25rpx;
-	.golden{
+
+	.code {
+		width: 277rpx;
+		height: 277rpx;
+		margin: 25rpx auto;
+		margin-bottom: 35rpx;
 		background: #0C5AFA;
-		color: #fff;
 	}
-}
-.login_name {
-	width: 480rpx;
-	color: #ffffff;
-}
-.login_name image {
-	width: 100rpx;
-	height: 100rpx;
-}
-.tip {
-	padding: 29rpx 31rpx;
-	line-height: 55rpx;
-	font-size: 24rpx;
-}
-.select_img {
-	width: 28rpx;
-	height: 32rpx;
-}
-.select_img image {
-	width: 100%;
-	height: 100%;
-}
-.scann {
-	margin-bottom: 35rpx;
-	margin-top: 15rpx;
-}
-.scanning {
-	background-color: #6f6f78;
-	color: #ffffff;
-	padding: 10rpx 30rpx;
-	border-radius: 15rpx;
-	font-size: 28rpx;
-}
-.address_code {
-	padding: 25rpx 0rpx;
-	color: #ffffff;
-}
-.input-placeholder{
-	color: #fff !important;
-}
-</style>
+
+	.code image {
+		width: 100%;
+		height: 100%;
+	}
+
+	.btnBox {
+		justify-content: center;
+		padding-bottom: 50rpx;
+		padding-top: 30rpx;
+
+		.btn {
+			font-family: PingFang SC;
+			font-weight: bold;
+			font-size: 26rpx;
+			color: #0C5AFA;
+			border: 1rpx solid #0C5AFA;
+			padding: 15rpx 45rpx;
+			border-radius: 15rpx;
+		}
+	}
+
+	.submission {
+		padding: 30rpx 25rpx;
+
+		.golden {
+			background: #0C5AFA;
+			color: #fff;
+		}
+	}
+
+	.login_name {
+		width: 480rpx;
+		color: #ffffff;
+	}
+
+	.login_name image {
+		width: 100rpx;
+		height: 100rpx;
+	}
+
+	.tip {
+		padding: 29rpx 31rpx;
+		line-height: 55rpx;
+		font-size: 24rpx;
+	}
+
+	.select_img {
+		width: 28rpx;
+		height: 32rpx;
+	}
+
+	.select_img image {
+		width: 100%;
+		height: 100%;
+	}
+
+	.scann {
+		margin-bottom: 35rpx;
+		margin-top: 15rpx;
+	}
+
+	.scanning {
+		background-color: #6f6f78;
+		color: #ffffff;
+		padding: 10rpx 30rpx;
+		border-radius: 15rpx;
+		font-size: 28rpx;
+	}
+
+	.address_code {
+		padding: 25rpx 0rpx;
+		color: #ffffff;
+	}
+
+	.input-placeholder {
+		color: #fff !important;
+	}
+</style>

+ 48 - 11
pages/user/money.vue

@@ -1,7 +1,7 @@
 <template>
 	<view class="container">
 		<view class="topBox">
-			<image src="/static/image/img32.png" style="width: 119rpx;" mode="widthFix"></image>
+			<image  :src="dataMoney[type]?dataMoney[type].LOGO:''" class="logo" mode="scaleToFill"></image>
 			<view class="money">{{money}}</view>
 		</view>
 		<view class="listBox">
@@ -9,31 +9,57 @@
 			<view class="listTpl flex" v-for="item,index in list" :key="index">
 				<view class="tplInfo flex_item">
 					<image src="/static/image/img33.png" style="width: 39rpx;" mode="widthFix"></image>
-					<view class="tpl">充币<text>2024-08-31 12:10:00</text></view>
+					<view class="tpl">{{item.title}}<text>{{item.add_time}}</text></view>
+				</view>
+				<view class="tip" :style="{color:( item.pm == 0? '#fff' :'#0C5AFA')}">
+					{{ item.pm == 1?'+':'-'}}
+					{{item.number}}
 				</view>
-				<view class="tip" :style="{color:( item.type == 1? '#fff' :'#0C5AFA')}">+7568</view>
 			</view>
 		</view>
+		<uni-load-more :status="loadingType"></uni-load-more>
 	</view>
 </template>
 <script>
+	import {
+		moneyLog,
+	} from '@/api/game.js';
+	import {
+		qianBao
+	} from '@/api/wallet.js';
 	export default {
 		data() {
 			return{
 				money:0,
 				page:1,
 				loadingType: "more",
-				list:[{type:1},{type:1},{type:2},{type:2},{type:2},{type:2},{type:2},{},{},{}]
+				list:[],
+				type:'',
+				dataMoney:{}
+				
 			};
 		},
-		onLoad() {
-			// this.loadData()
+		onLoad(opt) {
+			this.type = opt.type;
+			this.loadData();
+			this.qianbao();
+			uni.setNavigationBarTitle({
+				title:this.type
+			})
 		},
 		onShow() {},
 		onReachBottom() {
 			// this.loadData()
 		},
 		methods: {
+			qianbao() {
+				const that = this;
+				qianBao().then((res) => {
+					that.dataMoney = res.data.back;
+					that.money = that.dataMoney[that.type].money.money*1;
+					console.log(that.dataMoney,'that.money');
+				})
+			},
 			loadData(){
 				let obj = this;
 				if (obj.loadingType == "nomore" ||
@@ -41,14 +67,19 @@
 					return;
 				}
 				obj.loadingType = "loading";
-				getList({
+				moneyLog({
 					page:obj.page,
-					limit:10
+					limit:10,
+					moneyType:obj.type
 				},obj.status).then(res => {
-					if (res.length > 0) {
-						obj.list = obj.list.concat(res);
+					let ar = res.data.list.map((re)=>{
+						re.number = +re.number
+						return re
+					})
+					if (ar.length > 0) {
+						obj.list = obj.list.concat(ar);
 						obj.page++;
-						if (obj.limit == res.length) {
+						if (obj.limit == ar.length) {
 							obj.loadingType = "more";
 						} else {
 							obj.loadingType = "nomore";
@@ -63,6 +94,12 @@
 	.container{
 		padding: 25rpx 25rpx;
 	}
+	.logo{
+		width: 120rpx;
+		height: 120rpx;
+		border-radius: 100%;
+		background-color: #e3e3e3;
+	}
 	.topBox{
 		text-align: center;
 		padding-top: 25rpx;

+ 8 - 0
pages/user/set/bindBank.vue

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

+ 145 - 132
pages/user/set/password.vue

@@ -1,162 +1,175 @@
 <template>
 	<view class="container">
-		<view class="row b-b">
+		<view class="row flex">
 			<text class="tit">{{$t('set.a3')}}</text>
-			<input class="input" v-model="account" disabled type="text" :placeholder="$t('reg.c3')" placeholder-class="placeholder" />
+			<input class="input" v-model="account" disabled type="text" :placeholder="$t('reg.c3')"
+				placeholder-class="placeholder" />
 		</view>
-		
-		<view class="row b-b">
+
+		<view class="row flex">
 			<text class="tit">{{$t('safe.b3')}}</text>
-			<input class="input" v-model="password" type="password" :placeholder="$t('safe.b4')" placeholder-class="placeholder" />
+			<input class="input" v-model="password" type="password" :placeholder="$t('safe.b4')"
+				placeholder-class="placeholder" />
 		</view>
-		
-		<view class="row b-b">
+
+		<view class="row flex">
 			<text class="tit">{{$t('safe.a7')}}</text>
-			<input class="input" v-model="captcha" type="text" :placeholder="$t('safe.a6')" placeholder-class="placeholder" />
+			<input class="input" v-model="captcha" type="text" :placeholder="$t('safe.a6')"
+				placeholder-class="placeholder" />
 			<view class="code" @click="verification">{{ countDown == 0 ? '验证码' : countDown }}</view>
-			
-			
-			
 		</view>
-	
+
 		<button class="add-btn" :class="{'bg-gray':loding}" @click="loding?'':confirm()">{{$t('set.a5')}}</button>
 	</view>
 </template>
 
 <script>
-import { verify } from '@/api/login.js';
-import { mapState } from 'vuex';
-import { registerReset } from '@/api/set.js';
-export default {
-	data() {
-		return {
-			time: '', //保存倒计时对象
-			countDown: 0, //倒计时
-			account: '', //手机号
-			captcha: '', //验证码
-			password: '' ,//新密码
-			loding:false,//是否载入中
-		};
-	},
-	computed: {
-		...mapState("user",['userInfo'])
-	},
-	onLoad() {
-		if(this.userInfo.account == null){
-			this.account = '';
-		}else{
-			this.account = this.userInfo.account;
-			this.show = false;
-		}
-	},
-	watch: {
-		// 监听倒计时
-		countDown(i) {
-			if (i == 0) {
-				clearInterval(this.time);
+	import {
+		verify
+	} from '@/api/login.js';
+	import {
+		mapState
+	} from 'vuex';
+	import {
+		registerReset
+	} from '@/api/set.js';
+	export default {
+		data() {
+			return {
+				time: '', //保存倒计时对象
+				countDown: 0, //倒计时
+				account: '', //手机号
+				captcha: '', //验证码
+				password: '', //新密码
+				loding: false, //是否载入中
+			};
+		},
+		computed: {
+			...mapState("user", ['userInfo'])
+		},
+		onLoad() {
+			if (this.userInfo.account == null) {
+				this.account = '';
+			} else {
+				this.account = this.userInfo.account;
+				this.show = false;
 			}
-		}
-	},
-	methods: {
-		//发送验证码
-		verification() {
-			let obj = this;
-			if (this.account == '') {
-				this.$api.msg(obj.$t("reg.a3"));
-				return;
+		},
+		watch: {
+			// 监听倒计时
+			countDown(i) {
+				if (i == 0) {
+					clearInterval(this.time);
+				}
 			}
-			if (!/(^1[3|4|5|7|8][0-9]{9}$)/.test(this.account)) {
-				this.$api.msg(obj.$t("safe.b8"));
-				return;
-			} 
-			// 判断是否在倒计时
-			if (obj.countDown > 0) {
-				return false;
-			} else {
-				obj.countDown = 60;
-				obj.time = setInterval(() => {
-					obj.countDown--;
-				}, 1000);
-				//调用验证码接口
-				verify({
-					phone: obj.account,
-					type: ''
-				})
-					.then(({ data }) => {})
+		},
+		methods: {
+			//发送验证码
+			verification() {
+				let obj = this;
+				if (this.account == '') {
+					this.$api.msg(obj.$t("reg.a3"));
+					return;
+				}
+				if (!/(^1[3|4|5|7|8][0-9]{9}$)/.test(this.account)) {
+					this.$api.msg(obj.$t("safe.b8"));
+					return;
+				}
+				// 判断是否在倒计时
+				if (obj.countDown > 0) {
+					return false;
+				} else {
+					obj.countDown = 60;
+					obj.time = setInterval(() => {
+						obj.countDown--;
+					}, 1000);
+					//调用验证码接口
+					verify({
+							phone: obj.account,
+							type: ''
+						})
+						.then(({
+							data
+						}) => {})
+						.catch(err => {
+							console.log(err);
+						});
+				}
+			},
+			confirm(e) {
+				this.loding = true;
+				registerReset({
+						account: this.account,
+						captcha: this.captcha,
+						password: this.password,
+					})
+					.then(({
+						data
+					}) => {
+						this.loding = false;
+						this.$api.msg(obj.$t("safe.d3"));
+					})
 					.catch(err => {
+						this.loding = false;
 						console.log(err);
 					});
 			}
-		},
-		confirm(e) {
-			this.loding = true;
-			registerReset({
-				account: this.account,
-				captcha: this.captcha,
-				password: this.password,
-			})
-				.then(({ data }) => {
-					this.loding = false;
-					this.$api.msg(obj.$t("safe.d3"));
-				})
-				.catch(err => {
-					this.loding = false;
-					console.log(err);
-				});
 		}
-	}
-};
+	};
 </script>
 
 <style lang="scss">
-page {
-	background: #f3f3f3;
-}
-.row {
-	display: flex;
-	align-items: center;
-	position: relative;
-	padding: 0 30rpx;
-	height: 110rpx;
-	background: #fff;
+	page {
+		background-color: #051137;
+	}
 
-	.tit {
-		flex-shrink: 0;
-		width: 120rpx;
-		font-size: 30rpx;
-		color: $font-color-dark;
+	.row {
+		padding: 20rpx;
+		background: #fff;
+		background-color: #1F2A4A;
+		border-radius: 10rpx;
+		margin: 0 30rpx 30rpx 30rpx;
+
+		.tit {
+			flex-shrink: 0;
+			font-size: $font-base;
+			color: #FFF;
+			width: 4em;
+
+		}
+
+		.input {
+			text-align: left;
+			font-size: $font-base;
+			color: $color-gray;
+			flex-grow: 1;
+		}
+
+		.iconlocation {
+			font-size: 36rpx;
+			color: $font-color-light;
+		}
 	}
-	.input {
-		flex: 1;
+
+	.add-btn {
+		background: linear-gradient(90deg, #0C5AFA, #1356FF);
+		margin: 30rpx;
+		color: #FFF;
 		font-size: 30rpx;
-		color: $font-color-dark;
+		text-align: center;
+		border-radius: 10rpx;
 	}
-	.iconlocation {
-		font-size: 36rpx;
-		color: $font-color-light;
+
+	.bg-gray {
+		background-color: $color-gray;
 	}
-}
-.add-btn {
-	display: flex;
-	align-items: center;
-	justify-content: center;
-	height: 100rpx;
-	margin: 60rpx auto;
-	font-size: $font-lg;
-	background-color: #FFF;
-	border-radius: 10rpx;
-	// box-shadow: 1px 2px 5px rgba(219, 63, 96, 0.4);
-}
 
-.bg-gray{
-	background-color: $color-gray;
-}
-.code {
-	color: #5dbc7c;
-	font-size: 23rpx;
-	border-left: 1px solid #eeeeee;
-	width: 150rpx;
-	flex-shrink: 0;
-	text-align: center;
-}
-</style>
+	.code {
+		color: #FFF;
+		font-size: 23rpx;
+		border-left: 1px solid #eeeeee;
+		width: 150rpx;
+		flex-shrink: 0;
+		text-align: center;
+	}
+</style>

+ 103 - 33
pages/user/set/set.vue

@@ -1,10 +1,84 @@
 <template>
 	<view class="container">
-		<uni-list>
-		    <uni-list-item :title="$t('safe.f6')" clickable showArrow  @click="navTo('/pages/user/set/userinfo')" ></uni-list-item>
-			<!-- <uni-list-item :title="$t('safe.f7')" clickable showArrow  @click="navTo('/pages/user/set/password')" ></uni-list-item> -->
-			<uni-list-item :title="$t('safe.d1')" clickable showArrow  @click="navTo('/pages/user/set/transaction')" ></uni-list-item>
-		</uni-list>
+		<view class="list">
+			<view class="flex item" @click="navTo('/pages/user/set/userinfo')">
+				<view class="left flex-start">
+					<uni-icons type="person" :size="iconSize" :color="listColor"></uni-icons>
+					<text class="title">
+						个人信息
+					</text>
+				</view>
+				<view class="right">
+					<uni-icons type="right" :color='iconColor'></uni-icons>
+				</view>
+			</view>
+			<view class="flex item" @click="navTo('/pages/user/set/team')">
+				<view class="left flex-start">
+					<uni-icons type="staff" :size="iconSize" :color="listColor"></uni-icons>
+					<text class="title">
+						我的推广
+					</text>
+				</view>
+				<view class="right">
+					<uni-icons type="right" :color='iconColor'></uni-icons>
+				</view>
+			</view>
+			<view class="flex item" @click="navTo('/pages/user/set/shareQrCode')">
+				<view class="left flex-start">
+					<uni-icons type="personadd" :size="iconSize" :color="listColor"></uni-icons>
+					<text class="title">
+						我的推广码
+					</text>
+				</view>
+				<view class="right">
+					<uni-icons type="right" :color='iconColor'></uni-icons>
+				</view>
+			</view>
+			<view class="flex item" @click="navTo('/pages/user/set/transaction')">
+				<view class="left flex-start">
+					<uni-icons type="locked" :size="iconSize" :color="listColor"></uni-icons>
+					<text class="title">
+						支付密码修改
+					</text>
+				</view>
+				<view class="right">
+					<uni-icons type="right" :color='iconColor'></uni-icons>
+				</view>
+			</view>
+			<view class="flex item" @click="navTo('/pages/user/set/password')">
+				<view class="left flex-start">
+					<uni-icons type="locked" :size="iconSize" :color="listColor"></uni-icons>
+					<text class="title">
+						登录密码修改
+					</text>
+				</view>
+				<view class="right">
+					<uni-icons type="right" :color='iconColor'></uni-icons>
+				</view>
+			</view>
+			<view class="flex item" @click="navTo('/pages/user/set/bindBank')">
+				<view class="left flex-start">
+					<uni-icons type="staff" :size="iconSize" :color="listColor"></uni-icons>
+					<text class="title">
+						我的银行卡
+					</text>
+				</view>
+				<view class="right">
+					<uni-icons type="right" :color='iconColor'></uni-icons>
+				</view>
+			</view>
+			<view class="flex item">
+				<view class="left flex-start">
+					<uni-icons type="wallet" :size="iconSize" :color="listColor"></uni-icons>
+					<text class="title">
+						收款信息
+					</text>
+				</view>
+				<view class="right">
+					<uni-icons type="right" :color='iconColor'></uni-icons>
+				</view>
+			</view>
+		</view>
 		<view class="list-cell log-out-btn" @click="toLogout">
 			<text class="cell-tit">{{$t('accountSettings.a9')}}</text>
 		</view>
@@ -19,7 +93,9 @@
 	export default {
 		data() {
 			return {
-				
+				iconSize:'20',
+				listColor:'#1356FF',
+				iconColor:'#999'
 			};
 		},
 		methods:{
@@ -55,35 +131,29 @@
 
 <style lang='scss'>
 	page{
-		background: #f3f3f3;
+		background-color: #051137;
 	}
-	.list-cell{
-		display:flex;
-		align-items:baseline;
-		padding: 20rpx $page-row-spacing;
-		line-height:60rpx;
-		position:relative;
-		background: #fff;
-		justify-content: center;
-		&.log-out-btn{
-			margin-top: 40rpx;
-			.cell-tit{
-				text-align: center;
-				margin-right: 0;
-			}
-		}
-		.cell-tit{
-			flex: 1;
-			font-size: $font-base + 2rpx;
-			color: $font-color-dark;
-			margin-right:10rpx;
-		}
-		.cell-tip{
+	.container{
+		padding: 30rpx;
+	}
+	.item{
+		background-color: #1F2A4A;
+		border-radius: 10rpx;
+		padding: 20rpx 20rpx;
+		color: #FFF;
+		margin-bottom: 30rpx;
+		.title{
+			padding-left: 10rpx;
 			font-size: $font-base;
-			color: $font-color-light;
-		}
-		switch{
-			transform: translateX(16rpx) scale(.84);
 		}
 	}
+	.list-cell{
+		background: linear-gradient(90deg, #0C5AFA, #1356FF);
+		text-align: center;
+		color: #FFF;
+		padding: 20rpx;
+		line-height: 1;
+		border-radius: 10rpx;
+		font-size: 30rpx;
+	}
 </style>

+ 299 - 0
pages/user/set/shareQrCode.vue

@@ -0,0 +1,299 @@
+<template>
+	<view class="container">
+		<swiper
+			class="posters-box"
+			:autoplay="false"
+			:circular="false"
+			:interval="3000"
+			:duration="500"
+			@change="bindchange"
+			previous-margin="40px"
+			next-margin="40px">
+			<block
+				v-for="(item, index) in shareList"
+				:key="index">
+				<swiper-item>
+					<!-- #ifndef MP -->
+					<image
+						class="slide-image"
+						:class="swiperIndex == index ? 'active' : 'quiet'"
+						mode="aspectFill"
+						:src="item.wap_poster"></image>
+					<!-- #endif -->
+
+					<!-- #ifdef MP -->
+					<image
+						class="slide-image"
+						:class="swiperIndex == index ? 'active' : 'quiet'"
+						mode="aspectFill"
+						:src="item.poster"></image>
+					<!-- #endif -->
+				</swiper-item>
+			</block>
+		</swiper>
+		<!-- #ifndef MP -->
+		<div class="preserve">
+			<div class="line"></div>
+			<div class="tip">{{$t('huiyuan.b1')}}</div>
+			<div class="line"></div>
+		</div>
+		<!-- #endif -->
+
+		<!-- #ifdef MP -->
+		<view
+			class="keep"
+			@click="savePosterPath"
+			>{{$t('huiyuan.b2')}}</view
+		>
+		<!-- #endif -->
+	</view>
+</template>
+
+<script>
+	import { spreadBanner } from "@/api/user.js";
+	import { mapState } from "vuex";
+	export default {
+		// #ifdef MP
+		onShareAppMessage: function (res) {
+			// 保存邀请人
+			let path = "/pages/index/index?" + "spread=" + this.userInfo.uid;
+			let data = {
+				path: path,
+				imageUrl: this.poster,
+				title: this.userInfo.nickname +  this.$t("huiyuan.b3"),
+			};
+			return data;
+		},
+		// #endif
+		data() {
+			return {
+				shareList: [],
+				swiperIndex: 0,
+				poster: "", // 当前海报
+			};
+		},
+		onLoad(option) {
+			uni.setNavigationBarTitle({
+				title: this.$t("tab.b2"),
+			});
+			this.loadData();
+		},
+		computed: {
+			...mapState("user", ["userInfo"]),
+		},
+		methods: {
+			bindchange(e) {
+				let shareList = this.shareList;
+				this.swiperIndex = e.detail.current;
+				// #ifdef MP
+				this.poster = shareList[this.swiperIndex].poster;
+				// #endif
+
+				console.log(this.poster);
+			},
+
+			// 保存海报
+			savePosterPath: function () {
+				let that = this;
+				if (that.poster == "") {
+					that.poster = that.shareList[0].poster;
+				}
+				uni.downloadFile({
+					url: that.poster,
+					success(resFile) {
+						if (resFile.statusCode === 200) {
+							uni.getSetting({
+								success(res) {
+									if (
+										!res.authSetting[
+											"scope.writePhotosAlbum"
+										]
+									) {
+										uni.authorize({
+											scope: "scope.writePhotosAlbum",
+											success() {
+												uni.saveImageToPhotosAlbum({
+													filePath:
+														resFile.tempFilePath,
+													success: function (res) {
+														return that.$api.msg(
+															 this.$t("huiyuan.b4")
+														);
+													},
+													fail: function (res) {
+														return that.$api.msg(
+															res.errMsg
+														);
+													},
+													complete: function (res) {},
+												});
+											},
+											fail() {
+												uni.showModal({
+													title: this.$t("huiyuan.b5"),
+													content:
+														 this.$t("huiyuan.b6"),
+													success(res) {
+														if (res.confirm) {
+															uni.openSetting({
+																success:
+																	function (
+																		res
+																	) {
+																		console.log(
+																			res.authSetting
+																		);
+																	},
+															});
+														} else if (res.cancel) {
+															return that.$api.msg(
+																 this.$t("huiyuan.b7")
+															);
+														}
+													},
+												});
+											},
+										});
+									} else {
+										uni.saveImageToPhotosAlbum({
+											filePath: resFile.tempFilePath,
+											success: function (res) {
+												return that.$api.msg(
+													 this.$t("huiyuan.b8")
+												);
+											},
+											fail: function (res) {
+												return that.$api.msg(
+													res.errMsg
+												);
+											},
+											complete: function (res) {},
+										});
+									}
+								},
+								fail(res) {},
+							});
+						} else {
+							return that.$api.msg(resFile.errMsg);
+						}
+					},
+					fail(res) {
+						return that.$api.msg(res.errMsg);
+					},
+				});
+			},
+
+			// #ifdef MP-WEIXIN
+			// 保存画图图片到本地
+			seav(url) {
+				uni.showLoading({
+					title:  this.$t("huiyuan.b9"),
+					mask: true,
+				});
+				uni.saveImageToPhotosAlbum({
+					filePath: this.poster,
+					complete(result) {
+						uni.hideLoading();
+						console.log(result);
+						uni.showToast({
+							title:  this.$t("huiyuan.b0"),
+							duration: 2000,
+							icon: "none",
+						});
+					},
+				});
+			},
+			// #endif
+
+			// 获取海报
+			loadData() {
+				let obj = this;
+				uni.showLoading({
+					title: "获取中",
+					mask: true,
+				});
+				spreadBanner({
+					// #ifdef H5
+					type: 2,
+					// #endif
+					// #ifdef MP
+					type: 1,
+					// #endif
+				})
+					.then(res => {
+						uni.hideLoading();
+						obj.shareList = res.data;
+						console.log("obj.shareList", obj.shareList);
+					})
+					.catch(err => {
+						uni.hideLoading();
+					});
+			},
+		},
+	};
+</script>
+
+<style lang="scss">
+	page {
+		background: #a3a3a3;
+		height: 100%;
+	}
+
+	.container {
+		width: 100%;
+
+		.posters-box {
+			width: 100%;
+			height: 1000rpx;
+			margin-top: 40rpx;
+
+			.slide-image {
+				width: 100%;
+				height: 100%;
+				border-radius: 15rpx;
+			}
+		}
+
+		.posters-box .slide-image.active {
+			transform: none;
+			transition: all 0.2s ease-in 0s;
+		}
+
+		.posters-box .slide-image.quiet {
+			transform: scale(0.8333333);
+			transition: all 0.2s ease-in 0s;
+		}
+
+		.keep {
+			font-size: 30rpx;
+			background: $base-color;
+			color: #fff;
+			width: 600rpx;
+			height: 80rpx;
+			border-radius: 50rpx;
+			text-align: center;
+			line-height: 80rpx;
+			margin: 38rpx auto;
+		}
+	}
+
+	.preserve {
+		color: #fff;
+		text-align: center;
+		margin-top: 38rpx;
+		display: flex;
+		align-items: center;
+		justify-content: center;
+
+		.line {
+			width: 100rpx;
+			height: 1px;
+			background-color: #fff;
+		}
+
+		.tip {
+			margin: 0 20rpx;
+			font-size: 28rpx;
+		}
+	}
+</style>

+ 598 - 0
pages/user/set/team.vue

@@ -0,0 +1,598 @@
+<template>
+	<view class="content">
+		<view class="content-money">
+			<!-- <view class="content-bg">
+				<image src="../../static/img/tg-bg.png" mode=""></image>
+			</view> -->
+			<view class="money-box">
+				<view class="money">{{ userInfo.spread_count|| '0' }}
+				<text class="pepole">人</text></view>
+			</view>
+		<!-- 	<view class="money-box flex" style="padding: 20rpx 40rpx;" @click="navto('/pages/user/pushList')">
+				<view>下级消费记录</view>
+			</view> -->
+		</view>
+		<!-- <view class="info-box flex">
+			<view class="info-item">
+				<view class="info-font">直推业绩</view>
+				<view class="info-num">{{recommend.numberCount || '0'}}</view>
+			</view>
+			<view class="shu"></view>
+			<view class="info-item">
+				<view class="info-font">团队业绩</view>
+				<view class="info-num">{{group.numberCount || '0'}}</view>
+			</view>
+		</view> -->
+		<!-- <view class="time-in">
+			<picker mode="date" @change="bindStartDateChange">
+				<input type="text" v-model="start_time" class="showtime" placeholder="请输入开始时间" disabled>
+			</picker>
+			<picker mode="date" @change="bindEndDateChange">
+				<input type="text" v-model="end_time" class="showtime" placeholder="请输入结束时间" disabled>
+			</picker>
+			<view class="search" @click="loadData('reload')">
+				搜索
+			</view>
+		</view> -->
+		<!-- <view class="flex buttom-box">
+			<view class="buttom"  @click="tabClick(0)">
+				<view class="money">{{all || 0}}</view>
+				<text class="text" :class="{ current: tabCurrentIndex === 0 }">一级推广</text>
+			</view>
+			<view class="buttom"  @click="tabClick(1)">
+				<view class="money">{{totalLevel || 0}}</view>
+				<text class="text" :class="{ current: tabCurrentIndex === 1 }">二级推广</text>
+			</view>
+		</view> -->
+		<swiper :current="tabCurrentIndex" :style="{ height: maxheight }" class="swiper-box" duration="300"
+			@change="changeTab" disable-touch>
+			<swiper-item class="tab-content" v-for="(tabItem, tabIndex) in navList" :key="tabIndex">
+				<scroll-view class="list-scroll-content" :style="{ height: maxheight }" scroll-y>
+					<empty v-if="tabItem.loaded === true && tabItem.orderList.length === 0"></empty>
+					<view v-for="(item, index) in tabItem.orderList" :key="index" class="order-item flex">
+						<view class="title-box flex_item">
+							<view class="title-avatar">
+								<image :src="item.avatar"></image>
+							</view>
+							<view class="list_tpl">
+								<view class="title">
+									<view class="title-name clamp">{{ item.nickname }}</view>
+								</view>
+								<view class="time">
+									<text>{{item.phone}}</text>
+								</view>
+								<view class="time">
+									<text>订单数:{{item.orderCount || '0'}} 消费金额:{{item.numberCount || '0'}}</text>
+								</view>
+							</view>
+						</view>
+					</view>
+					<uni-load-more :status="tabItem.loadingType"></uni-load-more>
+				</scroll-view>
+			</swiper-item>
+		</swiper>
+	</view>
+</template>
+<script>
+	import {
+		myspread,
+		myteam,
+		getPushList
+	} from '@/api/user.js';
+	import empty from '@/components/empty';
+	import {
+		mapState,
+		mapMutations
+	} from 'vuex';
+	export default {
+		components: {
+			empty,
+		},
+		onReady(res) {
+			var _this = this;
+			uni.getSystemInfo({
+				success: resu => {
+					const query = uni.createSelectorQuery();
+					query.select('.swiper-box').boundingClientRect();
+					query.exec(function(res) {
+						_this.maxheight = resu.windowHeight - res[0].top + 'px';
+						console.log('打印页面的剩余高度', _this.height);
+					});
+				},
+				fail: res => {}
+			});
+		},
+		data() {
+			return {
+				recommend: {},
+				group: {},
+				// 头部图高度
+				maxheight: '',
+				tabCurrentIndex: 0,
+				navList: [{
+						state: 0,
+						text: '直接推荐',
+						loadingType: 'more',
+						orderList: [],
+						page: 1, //当前页数
+						limit: 10 ,//每次信息条数
+						loaded: false
+					},
+					{
+						state: 1,
+						text: '间接推荐',
+						loadingType: 'more',
+						orderList: [],
+						page: 1, //当前页数
+						limit: 10 ,//每次信息条数
+						loaded: false
+					}
+				],
+				all: '',
+				list: '',
+				totalLevel: '',
+				order: '',
+				zt_order: '',
+				jt_order: '',
+				teamcount: '',
+				ztcount: '',
+				start_time: '',
+				end_time: ''
+			};
+		},
+		computed: {
+			...mapState('user', ['userInfo', 'orderInfo', 'hasLogin']),
+			...mapState(['baseURL'])
+		},
+		onLoad(options) {
+			this.loadData();
+		},
+		onShow() {
+			
+			// getPushList().then(res => {
+			// 	console.log(res)
+			// })
+		},
+		methods: {
+			bindStartDateChange(e) {
+				console.log(e)
+				this.start_time = e.detail.value
+			},
+			bindEndDateChange(e) {
+				console.log(e)
+				this.end_time = e.detail.value
+			},
+			// 页面跳转
+			navto(e) {
+				uni.navigateTo({
+					url: e
+				});
+			},
+			//获取收入支出信息
+			async loadData(source) {
+				let obj = this
+				//这里是将订单挂载到tab列表下
+				let index = this.tabCurrentIndex;
+				let navItem = this.navList[index];
+				let state = navItem.state;
+				if (source === 'tabChange' && navItem.loaded === true) {
+					//tab切换只有第一次需要加载数据
+					return;
+				}
+				if (navItem.loadingType === 'loading') {
+					//防止重复加载
+					return;
+				}
+				if(source == 'reload') {
+					navItem.orderList = []
+				}
+				// if (navItem.loadingType === 'noMore') {
+				// 	//防止重复加载
+				// 	return;
+				// }
+				// 修改当前对象状态为加载中
+				navItem.loadingType = 'loading';
+				myspread({
+					page: navItem.page,
+					limit: navItem.limit,
+					grade: navItem.state
+					})
+					.then(({
+						data
+					}) => {
+						navItem.orderList = navItem.orderList.concat(data.list)
+						if(data.list.lenght == navItem.limit) {
+							navItem.loadingType = 'more'
+						}else {
+							navItem.loadingType = 'noMore'
+						}
+						navItem.loaded = true
+						obj.group = data.group
+						obj.recommend = data.recommend
+						// console.log(data);
+						// this.teamcount = data.team_count
+						// this.ztcount = data.zt_count
+						// this.order = data.order
+						// this.zt_order = data.zt_order
+						// this.jt_order = data.jt_order
+						// this.totalLevel = data.totalLevel
+						// navItem.orderList = data.list;
+						// navItem.loadingType = 'noMore'
+					})
+					.catch(e => {
+						console.log(e);
+					});
+			},
+			//swiper 切换
+			changeTab(e) {
+				this.tabCurrentIndex = e.target.current;
+				this.loadData('tabChange');
+			},
+			//顶部tab点击
+			tabClick(index) {
+				this.tabCurrentIndex = index;
+			},
+			// 点击返回 我的页面
+			toBack() {
+				uni.switchTab({
+					url: '/pages/user/user'
+				});
+			}
+		}
+	};
+</script>
+
+<style lang="scss">
+	page {
+		height: 100%;
+	}
+
+	.status_bar {
+		height: var(--status-bar-height);
+		width: 100%;
+		background: #5dbc7c;
+	}
+
+	.content-money {
+		position: relative;
+		height: 240rpx;
+
+		.content-bg {
+			position: absolute;
+			top: 0;
+			left: 0;
+			right: 0;
+			width: 750rpx;
+			height: 480rpx;
+
+			image {
+				width: 100%;
+				height: 100%;
+			}
+		}
+
+		.body-title {
+			height: 80rpx;
+			text-align: center;
+			font-size: 35rpx;
+			position: relative;
+
+			.header {
+				position: absolute;
+				left: 0;
+				top: 0;
+				width: 100%;
+				font-size: 36rpx;
+				font-family: PingFang SC;
+				font-weight: bold;
+				color: #6B4216;
+				height: 80rpx;
+				font-size: 36rpx;
+				font-weight: 700;
+				z-index: 9;
+				display: flex;
+				justify-content: center;
+				align-items: center;
+			}
+
+			.goback-box {
+				position: absolute;
+				left: 18rpx;
+				top: 0;
+				height: 80rpx;
+				display: flex;
+				align-items: center;
+			}
+
+			.goback {
+				z-index: 100;
+				width: 34rpx;
+				height: 34rpx;
+			}
+		}
+	}
+
+	.money-box {
+		position: relative;
+		z-index: 2;
+		padding-top: 50rpx;
+		color: #6B4216;
+		text-align: center;
+
+		.money {
+			font-size: 72rpx;
+			font-weight: bold;
+			color: #1356FF;
+			.pepole{
+				font-size: $font-base;
+			}
+		}
+
+		.text {
+			font-size: 30rpx;
+		}
+	}
+
+	.order-item {
+		padding: 20rpx 30rpx;
+		line-height: 1.5;
+		background-color: #fff;
+
+		.title-box {
+			width: 100%;
+
+			.title-avatar {
+				flex-shrink: 0;
+				width: 100rpx;
+				height: 100rpx;
+				margin-right: 25rpx;
+				border-radius: 100%;
+
+				image {
+					width: 100%;
+					height: 100%;
+					border-radius: 100%;
+				}
+			}
+
+			.list_tpl {
+				width: 85%;
+
+				.title {
+					display: flex;
+					justify-content: flex-start;
+					font-size: $font-lg;
+					color: $font-color-base;
+					overflow: hidden; //超出的文本隐藏
+					text-overflow: ellipsis; //溢出用省略号显示
+					white-space: nowrap;
+					line-height: 1;
+					text-align: center;
+
+					.title-name {
+						max-width: 40%;
+					}
+
+					.dl {
+						margin-left: 10rpx;
+						width: 93rpx;
+						height: 32rpx;
+						border-radius: 16rpx;
+
+						image {
+							width: 93rpx;
+							height: 32rpx;
+							border-radius: 16rpx;
+						}
+					}
+
+					.class {
+						display: inline-block;
+						margin-left: 10rpx;
+						padding: 6rpx;
+						text-align: center;
+						border: 1px solid #2e58ff;
+						border-radius: 16rpx;
+						font-size: 20rpx;
+						font-family: PingFang SC;
+						font-weight: 500;
+						color: #2e58ff;
+					}
+				}
+
+				.time {
+					font-size: $font-lg;
+					color: $font-color-light;
+				}
+			}
+		}
+
+		.money {
+			width: 50%;
+			text-align: right;
+			color: #db1935;
+			font-size: $font-lg;
+		}
+	}
+
+	.yeji {
+		position: relative;
+		margin: -72rpx auto 0;
+		width: 690rpx;
+		height: 143rpx;
+		background: #ffffff;
+		box-shadow: 0rpx 0rpx 20rpx 0rpx rgba(50, 50, 52, 0.06);
+		border-radius: 10rpx;
+		display: flex;
+		align-items: center;
+
+		.yeji-a {
+			width: 50%;
+			display: flex;
+			flex-direction: column;
+			justify-content: center;
+			align-items: center;
+
+			.yeji-top {
+				font-size: 28rpx;
+				font-family: PingFang SC;
+				font-weight: bold;
+				color: #333333;
+			}
+
+			.yeji-buttom {
+				font-size: 42rpx;
+				font-family: PingFang SC;
+				font-weight: bold;
+				color: #333333;
+			}
+		}
+
+		.border {
+			width: 1rpx;
+			height: 51rpx;
+			background: #dddddd;
+		}
+	}
+
+	.navbar {
+		margin-top: 20rpx;
+		display: flex;
+		height: 88rpx;
+		padding: 0 5px;
+		background: #fff;
+		box-shadow: 0 1px 5px rgba(0, 0, 0, 0.06);
+		position: relative;
+		z-index: 10;
+
+		.nav-item {
+			flex: 1;
+			display: flex;
+			justify-content: center;
+			align-items: center;
+			height: 100%;
+			font-size: 15px;
+			color: #999999;
+			position: relative;
+
+			&.current {
+				color: #000;
+
+				&:after {
+					content: '';
+					position: absolute;
+					left: 50%;
+					bottom: 0;
+					transform: translateX(-50%);
+					width: 44px;
+					height: 0;
+					border-bottom: 2px solid #fe5b38;
+				}
+			}
+		}
+	}
+
+	.buttom-box {
+		position: relative;
+		background-color: #ffffff;
+		text-align: center;
+		padding: 30rpx 0;
+
+		.buttom {
+			flex-grow: 1;
+		}
+
+		.money {
+
+			font-size: 32rpx;
+			font-weight: bold;
+			color: #ff4173;
+		}
+
+		.text {
+			padding-bottom: 26rpx;
+			font-size: 28rpx;
+			font-weight: 500;
+			color: #666666;
+
+			&.current {
+				border-bottom: 2px solid #ff4173;
+			}
+		}
+
+		.icon {
+			height: 50rpx;
+			width: 48rpx;
+			margin: 0 auto;
+
+			.icon-img {
+				width: 100%;
+				height: 100%;
+			}
+		}
+	}
+	.time-in {
+		display: flex;
+		margin-top: 20rpx;
+		height: 100rpx;
+		justify-content: space-around;
+		align-items: center;
+		background-color: #fff;
+		.showtime {
+			display: inline-block;
+			width: 300rpx;
+			height: 85rpx;
+			background-color: #eee;
+			border: 1px solid #999;
+			border-radius: 20rpx;
+			color: #000;
+			font-size: 32rpx;
+			padding-left: 20rpx;
+		}
+		.search {
+			width: 100rpx;
+			height: 50rpx;
+			border-radius: 50rpx;
+			background-color: #ff4575;
+			font-size: 32rpx;
+			text-align: center;
+			line-height: 50rpx;
+			color: #fff;
+		}
+	}
+	.info-box {
+		width: 670rpx;
+		height: 186rpx;
+		background: #ffffff;
+		box-shadow: 0px 0px 20rpx 0px rgba(50, 50, 52, 0.06);
+		border-radius: 20rpx;
+		margin: -100rpx auto 20rpx;
+		position: relative;
+		z-index: 2;
+		.info-item {
+			width: 50%;
+			display: flex;
+			flex-direction: column;
+			align-items: center;
+			line-height: 1;
+			.info-font {
+				font-size: 30rpx;
+				font-family: PingFang SC;
+				font-weight: bold;
+				color: #999999;
+			}
+			.info-num {
+				margin-top: 30rpx;
+				font-size: 30rpx;
+				font-family: PingFang SC;
+				font-weight: bold;
+				color: #181818;
+			}
+		}
+		.shu {
+			width: 2rpx;
+			height: 74rpx;
+			background: #dcdfe6;
+		}
+	}
+</style>

+ 38 - 66
pages/user/set/transaction.vue

@@ -1,25 +1,25 @@
 <template>
 	<view class="container">
-		<view class="row b-b">
+		<view class="row ">
 			<text class="tit">{{$t('set.a3')}}</text>
 			<input class="input" disabled v-model="account" type="text" :placeholder="$t('reg.a3')"
 				placeholder-class="placeholder" />
 		</view>
-		<view class="row b-b">
+		<view class="row ">
 			<text class="tit">{{$t('reg.a8')}}</text>
 			<input class="input" v-model="password" type="password" :placeholder="$t('reg.a9')"
 				placeholder-class="placeholder" />
 		</view>
-		<view class="row b-b">
+		<view class="row ">
 			<text class="tit">{{$t('reg.b0')}}</text>
 			<input class="input" v-model="repeat" type="password" :placeholder="$t('reg.b1')"
 				placeholder-class="placeholder" />
 		</view>
-		<!-- <view class="row b-b">
+		<view class="row">
 			<text class="tit">{{$t('reg.a6')}}</text>
 			<input class="input" v-model="captcha" type="text" :placeholder="$t('reg.a7')" placeholder-class="placeholder" />
 			<view class="code" @click="verification">{{ countDown == 0 ? $t('reg.c6') : countDown }}</view>
-		</view> -->
+		</view>
 		<button class="add-btn" :class="{'bg-gray':loding}"
 			@click="loding?'':confirm()">{{$t('common.submit')}}</button>
 	</view>
@@ -52,12 +52,13 @@
 			...mapState("user", ['userInfo'])
 		},
 		onLoad() {
-			if (this.userInfo.account == null) {
+			if (this.userInfo.phone == null) {
 				this.account = '';
 			} else {
-				this.account = this.userInfo.account;
+				this.account = this.userInfo.phone;
 				this.show = false;
 			}
+			console.log(this.userInfo,'this.userInfo');
 			uni.setNavigationBarTitle({
 				title: this.$t("tab.b3"),
 			});
@@ -105,50 +106,23 @@
 			},
 
 			async confirm(e) {
+				const obj = this;
 				this.loding = true;
-				uni.showLoading({
-					title: this.$t("userinfo.u23"),
-					mask: true
-				});
-				const provider = await detectEthereumProvider();
-				// 链接到MetaMask
-				ethereum.request({
-					method: 'eth_requestAccounts'
-				}).then((account) => {
-					console.log(account, 'account');
-					// this.$store.commit('accounts/connect_wallet', account[0]);
-					// localStorage.setItem('accounts', account)
-					const PKR_LOGIN = 'PKR_RESET' + (new Date()).getTime();
-					ethereum.request({
-						"method": "personal_sign",
-						"params": [
-							PKR_LOGIN,
-							account[0]
-						]
-					}).then((res) => {
-						Reset({
-								password: this.password,
-								repeat: this.repeat,
-								sign:res,
-								account: account[0],
-								msg:PKR_LOGIN
-							})
-							.then(() => {
-								this.loding = false;
-								uni.showToast({
-									title: this.$t("safe.d3"),
-									icon: "success",
-									mask: true
-								});
-							})
-							.catch(err => {
-								this.loding = false;
-								console.log(err);
-							});
+				Reset({
+						// account: this.account,
+						captcha: this.captcha,
+						password: this.password,
+					})
+					.then(({
+						data
+					}) => {
+						this.loding = false;
+						this.$api.msg("修改成功");
+					})
+					.catch(err => {
+						this.loding = false;
+						console.log(err);
 					});
-				});
-
-
 			}
 		}
 	};
@@ -156,27 +130,28 @@
 
 <style lang="scss">
 	page {
-		background: #f3f3f3;
+		background: #051137;
 	}
 
 	.row {
-
 		display: flex;
 		align-items: center;
 		position: relative;
-		padding: 0 30rpx;
-		height: 110rpx;
-		background: $font-color-white;
-
+		padding: 20rpx;
+		background: #1F2A4A;
+		margin: 0 30rpx 30rpx 30rpx;
+		border-radius: 10rpx;
+		color: #FFF;
+		
 		.tit {
 			min-width: 130rpx;
 			flex-shrink: 0;
-			font-size: 30rpx;
+			font-size: $font-base;
 		}
 
 		.input {
 			flex: 1;
-			font-size: 30rpx;
+			font-size: $font-base;
 			color: $font-color-light;
 			padding-left: 20rpx;
 		}
@@ -188,16 +163,13 @@
 	}
 
 	.add-btn {
-		display: flex;
-		align-items: center;
-		justify-content: center;
-		height: 100rpx;
-		margin: 60rpx auto;
-		font-size: $font-lg;
-		background-color: #FFF;
-		border: none;
+		background: linear-gradient(90deg, #0C5AFA, #1356FF);
+		margin: 30rpx;
+		color: #FFF;
+		font-size: 30rpx;
+		text-align: center;
+		border-radius: 10rpx;
 	}
-
 	.bg-gray {
 		background-color: $color-gray;
 	}

+ 31 - 71
pages/user/set/userinfo.vue

@@ -1,36 +1,26 @@
 <template>
 	<view class="content">
-		<view class="row1">
-			<text class="tit">{{$t('set.a1')}}</text>
+		<view class="row flex">
+			<text class="tit">头像</text>
 			<view class="background-img" @click="imgsub"><image class="background-img" v-model="userInfo.avatar" :src="userInfo.avatar" mode="aspectFill"></image></view>
 		</view>
-		<view class="row">
-			<text class="tit">{{$t('set.a2')}}</text>
+		<view class="row flex">
+			<text class="tit">昵称</text>
 			<input class="input" type="text" v-model="userInfo.nickname" placeholder-class="placeholder"/>
 		</view>
-		<vie<!-- w class="row">
-			<text class="tit">{{$t('set.a3')}}</text>
+		<view class="row flex">
+			<text class="tit">账号</text>
 			<view class="input">
-				{{userInfo.account}}
+				{{userInfo.phone}}
 			</view>
-		</view> -->
+		</view>
 		<!-- <view class="row">
 			<text class="tit">ID</text>
 			<input class="input" type="text"  disabled="true" v-model="userInfo.uid" placeholder-class="placeholder" />
 		</view> -->
 		<view class="list-cell log-out-btn" @click="confirm">
-			<text class="cell-tit">{{$t('set.a4')}}</text>
+			<text class="cell-tit">修改</text>
 		</view>
-		<uni-popup ref="popup" type="center">
-			<view class="psw-wrapper">
-				<view class="psw-title">{{$t('safe.f3')}}</view>
-				<input type="text" v-model="password" class="psw-ipt" />
-				<view class="psw-btn">
-					<text @click.stop="qx">{{$t('zy.b4')}}</text>
-					<text class="psw-qd" @click.stop="pswQd">{{$t('zy.b3')}}</text>
-				</view>
-			</view>
-		</uni-popup>
 	</view>
 </template>
 
@@ -140,65 +130,29 @@ export default {
 
 <style lang="scss">
 	page{
-		background-color: #f3f3f3;
+		background-color: #051137;
 	}
 	.list-cell{
-		display:flex;
-		align-items:baseline;
-		padding: 20rpx $page-row-spacing;
-		line-height:60rpx;
-		position:relative;
-		background: #fff;
-		justify-content: center;
-		&.log-out-btn{
-			margin-top: 40rpx;
-			.cell-tit{
-				text-align: center;
-				margin-right: 0;
-			}
-		}
-		.cell-tit{
-			flex: 1;
-			font-size: $font-base + 2rpx;
-			color: $font-color-dark;
-			margin-right:10rpx;
-		}
-	}
-	.row1 {
-		display: flex;
-		align-items: center;
-		justify-content: space-between;
-		position: relative;
-		padding: 0 30upx;
-		height: 110upx;
-		background: #fff;
-		margin-bottom: 20upx;
-		.tit {
-			flex-shrink: 0;
-			width: 120upx;
-			font-size: $font-lg;
-			color: $font-color-dark;
-		}
-		
-		.background-img {
-			width: 80rpx;
-			height: 80rpx;
-			border-radius: 50%;
-			background: #f2f2f2;
-		}
+		background: linear-gradient(90deg, #0C5AFA, #1356FF);
+		margin: 30rpx;
+		color: #FFF;
+		font-size: 30rpx;
+		padding: 20rpx;
+		text-align: center;
+		border-radius: 10rpx;
+		line-height: 1;
 	}
 	.row {
-		display: flex;
-		align-items: center;
-		padding: 0 30upx;
-		height: 110upx;
+		padding: 20rpx;
 		background: #fff;
-		border-bottom:1px solid $border-color-light ;
+		background-color:#1F2A4A ;
+		border-radius: 10rpx;
+		margin: 0 30rpx 30rpx 30rpx;
 		.tit {
 			flex-shrink: 0;
-			width: 120upx;
-			font-size: $font-lg;
-			color: $font-color-dark;
+			font-size: $font-base;
+			color:#FFF;
+			
 		}
 		.input {
 			flex: 1;
@@ -206,6 +160,12 @@ export default {
 			font-size: $font-base;
 			color: $color-gray;
 		}
+		.background-img {
+			width: 80rpx;
+			height: 80rpx;
+			border-radius: 50%;
+			background: #f2f2f2;
+		}
 	}
 	.add-btn {
 		display: flex;

+ 0 - 207
pages/user/shareQrCode.vue

@@ -1,207 +0,0 @@
-<template>
-	<view class="all">
-		<view class="list" v-for="item in list">
-			<view class="flex padding-b-20">
-				<view class="li">{{$t('set.a7')}}{{item.room.no}}{{$t('set.a8')}}</view>
-				<view class="lis" v-if="item.result === 1">
-					<view class="liss green">{{$t('enter.a5')}}</view>
-				</view>
-				<view class="lis" v-if="item.result === 0">
-					<view class="liss red">{{$t('enter.a6')}}</view>
-				</view>
-				<view class="lis" v-if="item.status === 0">
-					<view class="liss primary">{{$t('enter.a4')}}</view>
-				</view>
-			</view>
-			<view class="listT">
-				<!-- <view class="TT flex">
-					<view class="lsT">{{$t('gameList.a2')}}</view>
-					<view class="lisT">{{item.room.game.timebar}}</view>
-				</view> -->
-				<view class="TT flex">
-					<view class="lsT">{{$t('gameList.a4')}}</view>
-					<view class="lisT">{{item.num}}U</view>
-				</view>
-				<view class="TT flex">
-					<view class="lsT">{{$t('gameList.a7')}}</view>
-					<view class="lisT green" v-if="item.bet==1">{{ $t("enter.u6") }}</view>
-					<view class="lisT red" v-if="item.bet==2">{{ $t("enter.u4") }}</view>
-					<view class="lisT green" v-if="item.bet==3">{{ $t("enter.u5") }}</view>
-					<view class="lisT red" v-if="item.bet==4">{{ $t("enter.u7") }}</view>
-				</view>
-				<view class="TT flex">
-					<view class="lsT">{{$t('gameList.a8')}}</view>
-					<view class="lisT">{{item.get}}U</view>
-				</view>
-				<view class="TT flex">
-					<view class="lsT">{{$t('gameList.a9')}}</view>
-					<view class="flex-start">
-						<template v-for="it in item.room.arr " v-if="it.value==1">
-							<view class="lisT green" v-if="it.type==1">{{ $t("enter.u6") }}</view>
-							<view class="lisT green" v-if="it.type==3">{{ $t("enter.u5") }}</view>
-							<view class="lisT red" v-if="it.type==2">{{ $t("enter.u4") }}</view>
-							<view class="lisT red" v-if="it.type==4">{{ $t("enter.u7") }}</view>
-						</template>
-					</view>
-				</view>
-				<view class="TT flex">
-					<view class="lsT">{{$t('gameList.a10')}}</view>
-					<view class="lisT flex" v-if="item.room.result_info">
-					<image v-for="ls in item.room.result_info" class="dice"
-						:src="`../../static/img/dice${ls}.png`" mode="scaleToFill"></image>
-					</view>
-				</view>
-				<view class="TT flex">
-					<view class="lsT">{{$t('gameList.a5')}}</view>
-					<view class="lisT">{{item.open_time}}</view>
-				</view>
-			</view>
-		</view>
-	</view>
-</template>
-<script>
-	import {
-		gameBetList
-	} from '@/api/game.js'
-	import {
-		getTime
-	} from '@/utils/rocessor.js';
-	export default {
-		data() {
-			return {
-				id: 0,
-				page: 1,
-				limit: 10,
-				list: []
-			};
-		},
-		onLoad() {
-			this.gameBetList()
-			uni.setNavigationBarTitle({
-				title: this.$t("tab.a9"),
-			});
-		},
-		onReachBottom() {
-			this.gameBetList()
-		},
-		//下拉刷新
-		methods: {
-			// 互娱记录
-			gameBetList() {
-				let that = this
-				if (that.loadingType == 'loading' || that.loadingType == 'noMore') {
-					return
-				}
-				gameBetList({
-					page: that.page,
-					limit: that.limit,
-					id: that.id,
-				}).then(res => {
-					let list = res.data.bet_log.map((res) => {
-						res.num = +res.num;
-						res.get = +res.get;
-						res.room.result_info =  res.room.result_info.split(",");
-						let result = res.room.result
-						if (result) {
-							let arr = [];
-							const ar = result.split(",")
-							for (let i = 0; i < ar.length; i++) {
-								const s = ar[i].split(':');
-								arr.push({
-									type: s[0],
-									value: s[1]
-								})
-							}
-							res.room.arr = arr;
-						}
-						res.open_time = getTime(res.open_time);
-						return res
-					})
-					that.list = that.list.concat(list)
-					console.log('1111111', list);
-					that.page++
-					if (list.length == that.limit) {
-						that.loadingType = 'more'
-					} else {
-						that.loadingType = 'noMore'
-					}
-					that.loaded = true
-				})
-			}
-
-		}
-	};
-</script>
-
-<style lang="scss">
-	.all {
-		color: #FFFFFF;
-		padding: 30rpx;
-		line-height: 1;
-	}
-
-	.list {
-		background: #191A1F;
-		box-shadow: 0rpx 5rpx 24rpx 0rpx rgba(4, 0, 0, 0.06);
-		border-radius: 15rpx;
-		padding: 30rpx;
-		margin-bottom: 30rpx;
-
-		.li {
-			font-size: $font-lg;
-			font-weight: bold;
-		}
-
-		.lis {
-			.liss {
-				border-radius: 5rpx;
-				padding: 10rpx 20rpx;
-				font-size: 22rpx;
-				font-weight: 500;
-
-				&.red {
-					background: $color-yellow;
-				}
-
-				&.green {
-					background: $color-green;
-				}
-
-				&.primary {
-					background: #01ebf6;
-				}
-			}
-		}
-
-	}
-
-	.listT {
-		.TT {
-			margin-top: 20rpx;
-
-			.lsT {
-				font-weight: 500;
-				color: #999999;
-				font-size: $font-base;
-				min-width: 140rpx;
-			}
-
-			.lisT {
-				font-size: $font-lg;
-				font-weight: bold;
-				.dice {
-					width: 54rpx;
-					height: 54rpx;
-					margin-left: 10rpx;
-				}
-				&.red {
-					color: #df5660;
-				}
-
-				&.green {
-					color: $color-green;
-				}
-			}
-		}
-	}
-</style>

+ 85 - 24
pages/user/transfer.vue

@@ -3,18 +3,17 @@
 		<view class="listBox">
 			<view class="titleTetx">收款地址</view>
 			<view class="flex listTpl">
-				<input type="number" class="inputBox" v-model="address" placeholder="请输入收款地址"/>
+				<input type="number" class="inputBox" v-model="address" placeholder="请输入收款地址" />
 			</view>
 		</view>
 		<view class="listBox" style="padding-top: 0rpx;">
 			<view class="titleTetx">转账数量</view>
 			<view class="listTpl flex">
-				<input type="number" class="inputBox" v-model="number" placeholder="请输入转账金额"/>
-				<view class="listAll">全部</view>
+				<input type="number" class="inputBox" v-model="number" placeholder="请输入转账金额" />
+				<view class="listAll" @click="number=dataMoney.money">全部</view>
 			</view>
 			<view class="flex tipBox">
-				<view class="tip1">可用余额2.12USDT</view>
-				<view class="tip1">手续费:0.00USDT</view>
+				<view class="tip1">可用余额{{dataMoney.money||0}}USDT</view>
 			</view>
 		</view>
 		<view class="submission">
@@ -24,38 +23,95 @@
 </template>
 
 <script>
+	import {
+		trade
+	} from '@/api/game.js';
+	import {
+		qianBao
+	} from '@/api/wallet.js';
 	export default {
 		data() {
 			return {
-				address:'',
-				number:'',
+				address: '',
+				number: '',
+				dataMoney:{},
 			};
 		},
 		onLoad() {
-			
+			this.qianBao();
 		},
-		methods: {}
+		methods: {
+			qianBao(){
+				const taht = this;
+				qianBao({}).then(
+					(res) => {
+						taht.dataMoney = res.data.back.USDT.money
+						taht.dataMoney.money = +taht.dataMoney.money;
+					}
+				).catch(
+					(res) => {
+						
+					}
+				)
+			},
+			submission() {
+				const that = this;
+				uni.showModal({
+					title: '请输入支付密码',
+					editable:true,
+					success: res => {
+						if(res.confirm){
+							trade({
+								type: "",
+								num: that.number,
+								to_user_address: that.address,
+								trade_psw: res.content,
+							}).then(
+								(res) => {
+									uni.showToast({
+										title: e.msg,
+										duration: 1500,
+									});
+								}
+							).catch(
+								(res) => {
+									
+								}
+							)
+						}
+					},
+					fail: () => {},
+					complete: () => {}
+				});
+				
+			}
+
+		}
 	};
 </script>
 
 <style lang="scss">
-	.container{
-		padding:25rpx 25rpx;
+	.container {
+		padding: 25rpx 25rpx;
 	}
-	.listBox{
+
+	.listBox {
 		padding: 46rpx 25rpx;
 		background: #1F2A4A;
 		border-radius: 10rpx;
-		.titleTetx{
+
+		.titleTetx {
 			font-weight: bold;
 			font-size: 24rpx;
 			color: #FFFFFF;
 			padding-bottom: 25rpx;
 		}
-		.tipBox{
+
+		.tipBox {
 			padding-top: 15rpx;
 			font-size: 24rpx;
-			.tip1{
+
+			.tip1 {
 				font-family: PingFang SC;
 				font-weight: 500;
 				font-size: 26rpx;
@@ -64,32 +120,37 @@
 			}
 		}
 	}
-	.listTpl{
+
+	.listTpl {
 		border-bottom: 1rpx solid #6A7288;
 		padding-bottom: 25rpx;
-		.inputBox{
+
+		.inputBox {
 			font-size: 35rpx;
 			color: #FFFFFF;
 		}
-		.listTip{
-			
-		}
-		.listAll{
+
+		.listTip {}
+
+		.listAll {
 			padding-left: 30rpx;
 			font-size: 30rpx;
 			color: #0C5AFA;
 		}
 	}
-	.input-placeholder{
+
+	.input-placeholder {
 		font-family: PingFang SC;
 		font-weight: 500;
 		font-size: 26rpx;
 		color: #666666;
 	}
-	.submission{
+
+	.submission {
 		padding: 80rpx 25rpx;
 		padding-bottom: 25rpx;
-		.golden{
+
+		.golden {
 			background: #0C5AFA;
 			color: #ffffff;
 		}

+ 156 - 117
pages/user/withdrawal.vue

@@ -5,144 +5,183 @@
 			<view class="tplNum">USDT-TRC20</view>
 			<view class="tplName">提币地址</view>
 			<view class="inputBox">
-				<input class="input" type="text" v-model="address" placeholder="请输入提币地址"/>
+				<input class="input" type="text" v-model="address" placeholder="请输入提币地址" />
 			</view>
 			<view class="tplBox flex">
 				<view class="tplName">提币数量</view>
-				<view class="tplTip">可用0.00000000USDT</view>
+				<view class="tplTip">可用{{dataMoney.money||0}}USDT</view>
 			</view>
 			<view class="inputBox flex">
-				<input class="input" type="text" v-model="number" placeholder="请输入提币数量"/>
-				<view class="text">USDT <text>全部</text></view>
+				<input class="input" type="text" v-model="number" placeholder="请输入提币数量" />
+				<view class="text" @click="number=dataMoney.money">USDT <text>全部</text></view>
 			</view>
-			<view class="free">手续费:0</view>
+			<!-- <view class="free">手续费:0</view> -->
+		</view>
+		<view class="submission">
+			<button class="golden" type="golden" hover-class="none" @click="submission">确认提币</button>
 		</view>
 	</view>
 </template>
 <script type="text/javascript">
-export default {
-	data() {
-		return {
-			address:'',
-			number:''
-		};
-	},
-	onLoad() {},
-	methods: {
-		//获取数据
-		loadData() {
-		  // show_cb({})
-		  //   .then(data => {
-		  //     this.list = data.data;
-			 //  this.address = data.data.address;
-			 //  this.er_code = data.data.er_code;
-		  //   })
-		  //   .catch(err => {
-		  //     console.log(err);
-		  //   });
-		},
-		//确认提交
-		submission() {
-			let obj = this;
-			uni.showLoading({
-				title: '充币中...',
-				mask: true
-			});
-			//确认充值调接口,成功跳转页面
-			do_cb({
-				uid: obj.uid,
-				img: obj.img,
-				address: obj.address,
-				money: obj.money,
-				bz: obj.remark,
-			})
-				.then(function(e) {
-					uni.showToast({
-						title: '请耐心等待系统审核通过',
-						duration: 1500,
-						mask: false,
-						icon: 'none'
-					});
-					uni.hideLoading();
-				})
-				.catch(function(e) {
-					console.log(e);
-				});
+	import {
+		qianBao
+	} from '@/api/wallet.js';
+	export default {
+		data() {
+			return {
+				address: '',
+				number: '',
+				dataMoney: {},
+			};
 		},
-		//上传图片
-		scImg() {
-			upload({
-				file:''
-			}).then((e) => {
-				console.log(e,55)
-				this.img = e[0].url;
-			});
+		onLoad() {
+			this.loadData();
 		},
-	}
-};
+		methods: {
+			//获取数据
+			loadData() {
+				const that = this;
+				qianBao({})
+				  .then(res => {
+						that.dataMoney = res.data.back.USDT.money
+						that.dataMoney.money = +that.dataMoney.money
+						that.val = that.dataMoney.address;
+						console.log(that.dataMoney, 'dataMoney');
+					})
+				  .catch(err => {
+				    console.log(err);
+				  });
+			},
+			//确认提交
+			submission() {
+				let obj = this;
+				uni.showModal({
+					title: '请输入支付密码',
+					editable: true,
+					success: res => {
+						if (res.confirm) {
+							uni.showLoading({
+								title: '提交中。。。',
+								mask: true
+							});
+							//确认充值调接口,成功跳转页面
+							cash({
+									address: obj.address,
+									money: obj.money,
+									money_type: "",
+									trade_psw: res.content
+								})
+								.then(function(e) {
+									uni.showToast({
+										title: '请耐心等待系统审核通过',
+										duration: 1500,
+										mask: false,
+										icon: 'none'
+									});
+									uni.hideLoading();
+								})
+								.catch(function(e) {
+									uni.hideLoading();
+									console.log(e);
+								});
+						}
+					},
+				});
+
+			},
+			//上传图片
+			scImg() {
+				upload({
+					file: ''
+				}).then((e) => {
+					console.log(e, 55)
+					this.img = e[0].url;
+				});
+			},
+		}
+	};
 </script>
 
 <style lang="scss">
-.container{
-	padding: 25rpx 25rpx;
-}
-
-.recharge {
-	border-radius: 25rpx;
-	background-color: #1F2A4A;
-	padding: 37rpx 25rpx;
-	.tplName{
-		font-weight: bold;
-		font-size: 32rpx;
-		color: #FFFFFF;
-		line-height: 24rpx;
+	.container {
+		padding: 25rpx 25rpx;
 	}
-	.tplNum{
-		margin: 40rpx 0rpx;
-		padding: 15rpx 30rpx;
-		border-radius: 10rpx;
-		border: 1px solid #1356FF;
-		font-size: 26rpx;
-		color: #1356FF;
-		display: inline-block;
+
+	.recharge {
+		border-radius: 25rpx;
+		background-color: #1F2A4A;
+		padding: 37rpx 25rpx;
+
+		.tplName {
+			font-weight: bold;
+			font-size: 32rpx;
+			color: #FFFFFF;
+			line-height: 24rpx;
+		}
+
+		.tplNum {
+			margin: 40rpx 0rpx;
+			padding: 15rpx 30rpx;
+			border-radius: 10rpx;
+			border: 1px solid #1356FF;
+			font-size: 26rpx;
+			color: #1356FF;
+			display: inline-block;
+		}
+
+		.tplTip {
+			font-size: 20rpx;
+			color: #FFFFFF;
+		}
 	}
-	.tplTip{
-		font-size: 20rpx;
-		color: #FFFFFF;
+
+	.inputBox {
+		background: #29314D;
+		border-radius: 20rpx;
+		margin: 30rpx 0rpx;
+		padding: 0 25rpx;
+
+		.input {
+			height: 80rpx;
+			line-height: 80rpx;
+			color: #FFFFFF;
+		}
+
+		.text {
+			font-family: PingFang SC;
+			font-weight: 500;
+			font-size: 26rpx;
+			color: #FFFFFF;
+
+			text {
+				padding-left: 25rpx;
+			}
+		}
 	}
-}
-.inputBox{
-	background: #29314D;
-	border-radius: 20rpx;
-	margin: 30rpx 0rpx;
-	padding:0 25rpx;
-	.input{
-		height: 80rpx;
-		line-height: 80rpx;
-		color: #FFFFFF;
+
+	.free {
+		font-family: PingFang SC;
+		font-weight: 500;
+		font-size: 30rpx;
+		color: #1355F5;
+		text-align: center;
 	}
-	.text{
+
+	.input-placeholder {
 		font-family: PingFang SC;
 		font-weight: 500;
 		font-size: 26rpx;
-		color: #FFFFFF;
-		text{
-			padding-left: 25rpx;
+		color: #797C8B;
+		line-height: 24rpx;
+	}
+
+	.submission {
+		padding: 80rpx 25rpx;
+		padding-bottom: 25rpx;
+
+		.golden {
+			background: #0C5AFA;
+			color: #ffffff;
 		}
 	}
-}
-.free{
-	font-family: PingFang SC;
-	font-weight: 500;
-	font-size: 30rpx;
-	color: #1355F5;
-	text-align: center;
-}
-.input-placeholder{
-	font-family: PingFang SC;
-	font-weight: 500;
-	font-size: 26rpx;
-	color: #797C8B;
-	line-height: 24rpx;
-}
-</style>
+</style>

BIN
static/img/logo.jpg


BIN
static/img/logo.png


+ 1 - 1
store/index.js

@@ -21,7 +21,7 @@ const store = new Vuex.Store({
 			{
 			     value: 'cn',
 			     label: '简体中文'
-			   },
+			},
 			{
 				value: 'tw',
 				label: '繁體中文'

+ 44 - 0
utils/rocessor.js

@@ -119,3 +119,47 @@ export function getTime(time,type) {
 	
 	return year + '-' + mon + '-' + day + ' ' + (hours<10?`0${hours}`:hours) + ':' + (minu<10?`0${minu}`:minu) + ':' + (sec<10?`0${sec}`:sec);
 }
+
+export function copyText (content) {
+	
+		/**
+		 * 小程序端 和 app端的复制逻辑
+		 */
+		//#ifndef H5
+		uni.setClipboardData({
+			data: content,
+			success: function () {
+				uni.showToast({
+					title: '复制成功',
+				});
+			},
+		});
+		//#endif
+	
+		/**
+		 * H5端的复制逻辑
+		 */
+		// #ifdef H5
+		if (!document.queryCommandSupported("copy")) {
+			//为了兼容有些浏览器 queryCommandSupported 的判断
+			// 不支持
+			uni.showToast({
+				title: '浏览器不支持复制',
+				icon:"error"
+			});
+			return false;
+		}
+		let textarea = document.createElement("textarea");
+		textarea.value = content;
+		textarea.readOnly = "readOnly";
+		document.body.appendChild(textarea);
+		textarea.select(); // 选择对象
+		textarea.setSelectionRange(0, content.length); //核心
+		let result = document.execCommand("copy"); // 执行浏览器复制命令
+		textarea.remove();
+		uni.showToast({
+			title: '复制成功',
+		});
+		// #endif
+	
+}

+ 0 - 364
utils/util.js

@@ -1,364 +0,0 @@
-import {
- 	TOKENNAME,
- 	HTTP_REQUEST_URL
- } from '../config/app.js';
- import store from '../store';
- import {
- 	pathToBase64
- } from '@/plugin/image-tools/index.js';
- // #ifdef APP-PLUS
- // import permision from "permission.js"
- // #endif
- export default {
- 	/**
- 	 * opt  object | string
- 	 * to_url object | string
- 	 * 例:
- 	 * this.Tips('/pages/test/test'); 跳转不提示
- 	 * this.Tips({title:'提示'},'/pages/test/test'); 提示并跳转
- 	 * this.Tips({title:'提示'},{tab:1,url:'/pages/index/index'}); 提示并跳转值table上
- 	 * tab=1 一定时间后跳转至 table上
- 	 * tab=2 一定时间后跳转至非 table上
- 	 * tab=3 一定时间后返回上页面
- 	 * tab=4 关闭所有页面跳转至非table上
- 	 * tab=5 关闭当前页面跳转至table上
- 	 */
- 	Tips: function(opt, to_url) {
- 		if (typeof opt == 'string') {
- 			to_url = opt;
- 			opt = {};
- 		}
- 		let title = opt.title || '',
- 			icon = opt.icon || 'none',
- 			endtime = opt.endtime || 2000,
- 			success = opt.success;
- 		if (title) uni.showToast({
- 			title: title,
- 			icon: icon,
- 			duration: endtime,
- 			success
- 		})
- 		if (to_url != undefined) {
- 			if (typeof to_url == 'object') {
- 				let tab = to_url.tab || 1,
- 					url = to_url.url || '';
- 				switch (tab) {
- 					case 1:
- 						//一定时间后跳转至 table
- 						setTimeout(function() {
- 							uni.switchTab({
- 								url: url
- 							})
- 						}, endtime);
- 						break;
- 					case 2:
- 						//跳转至非table页面
- 						setTimeout(function() {
- 							uni.navigateTo({
- 								url: url,
- 							})
- 						}, endtime);
- 						break;
- 					case 3:
- 						//返回上页面
- 						setTimeout(function() {
- 							// #ifndef H5
- 							uni.navigateBack({
- 								delta: parseInt(url),
- 							})
- 							// #endif
- 							// #ifdef H5
- 							history.back();
- 							// #endif
- 						}, endtime);
- 						break;
- 					case 4:
- 						//关闭当前所有页面跳转至非table页面
- 						setTimeout(function() {
- 							uni.reLaunch({
- 								url: url,
- 							})
- 						}, endtime);
- 						break;
- 					case 5:
- 						//关闭当前页面跳转至非table页面
- 						setTimeout(function() {
- 							uni.redirectTo({
- 								url: url,
- 							})
- 						}, endtime);
- 						break;
- 				}
-
- 			} else if (typeof to_url == 'function') {
- 				setTimeout(function() {
- 					to_url && to_url();
- 				}, endtime);
- 			} else {
- 				//没有提示时跳转不延迟
- 				setTimeout(function() {
- 					uni.navigateTo({
- 						url: to_url,
- 					})
- 				}, title ? endtime : 0);
- 			}
- 		}
- 	},
- 	/**
- 	 * 移除数组中的某个数组并组成新的数组返回
- 	 * @param array array 需要移除的数组
- 	 * @param int index 需要移除的数组的键值
- 	 * @param string | int 值
- 	 * @return array
- 	 * 
- 	 */
- 	ArrayRemove: function(array, index, value) {
- 		const valueArray = [];
- 		if (array instanceof Array) {
- 			for (let i = 0; i < array.length; i++) {
- 				if (typeof index == 'number' && array[index] != i) {
- 					valueArray.push(array[i]);
- 				} else if (typeof index == 'string' && array[i][index] != value) {
- 					valueArray.push(array[i]);
- 				}
- 			}
- 		}
- 		return valueArray;
- 	},
- 	/**
- 	 * 生成海报获取文字
- 	 * @param string text 为传入的文本
- 	 * @param int num 为单行显示的字节长度
- 	 * @return array 
- 	 */
- 	textByteLength: function(text, num) {
- 		let strLength = 0;
- 		let rows = 1;
- 		let str = 0;
- 		let arr = [];
- 		for (let j = 0; j < text.length; j++) {
- 			if (text.charCodeAt(j) > 255) {
- 				strLength += 2;
- 				if (strLength > rows * num) {
- 					strLength++;
- 					arr.push(text.slice(str, j));
- 					str = j;
- 					rows++;
- 				}
- 			} else {
- 				strLength++;
- 				if (strLength > rows * num) {
- 					arr.push(text.slice(str, j));
- 					str = j;
- 					rows++;
- 				}
- 			}
- 		}
- 		arr.push(text.slice(str, text.length));
- 		return [strLength, arr, rows] //  [处理文字的总字节长度,每行显示内容的数组,行数]
- 	},
-
- 	/*
- 	 * 合并数组
- 	 */
- 	SplitArray(list, sp) {
- 		if (typeof list != 'object') return [];
- 		if (sp === undefined) sp = [];
- 		for (var i = 0; i < list.length; i++) {
- 			sp.push(list[i]);
- 		}
- 		return sp;
- 	},
- 	trim(str) {
- 		return String.prototype.trim.call(str);
- 	},
- 	$h: {
- 		//除法函数,用来得到精确的除法结果
- 		//说明:javascript的除法结果会有误差,在两个浮点数相除的时候会比较明显。这个函数返回较为精确的除法结果。
- 		//调用:$h.Div(arg1,arg2)
- 		//返回值:arg1除以arg2的精确结果
- 		Div: function(arg1, arg2) {
- 			arg1 = parseFloat(arg1);
- 			arg2 = parseFloat(arg2);
- 			var t1 = 0,
- 				t2 = 0,
- 				r1, r2;
- 			try {
- 				t1 = arg1.toString().split(".")[1].length;
- 			} catch (e) {}
- 			try {
- 				t2 = arg2.toString().split(".")[1].length;
- 			} catch (e) {}
- 			r1 = Number(arg1.toString().replace(".", ""));
- 			r2 = Number(arg2.toString().replace(".", ""));
- 			return this.Mul(r1 / r2, Math.pow(10, t2 - t1));
- 		},
- 		//加法函数,用来得到精确的加法结果
- 		//说明:javascript的加法结果会有误差,在两个浮点数相加的时候会比较明显。这个函数返回较为精确的加法结果。
- 		//调用:$h.Add(arg1,arg2)
- 		//返回值:arg1加上arg2的精确结果
- 		Add: function(arg1, arg2) {
- 			arg2 = parseFloat(arg2);
- 			var r1, r2, m;
- 			try {
- 				r1 = arg1.toString().split(".")[1].length
- 			} catch (e) {
- 				r1 = 0
- 			}
- 			try {
- 				r2 = arg2.toString().split(".")[1].length
- 			} catch (e) {
- 				r2 = 0
- 			}
- 			m = Math.pow(100, Math.max(r1, r2));
- 			return (this.Mul(arg1, m) + this.Mul(arg2, m)) / m;
- 		},
- 		//减法函数,用来得到精确的减法结果
- 		//说明:javascript的加法结果会有误差,在两个浮点数相加的时候会比较明显。这个函数返回较为精确的减法结果。
- 		//调用:$h.Sub(arg1,arg2)
- 		//返回值:arg1减去arg2的精确结果
- 		Sub: function(arg1, arg2) {
- 			arg1 = parseFloat(arg1);
- 			arg2 = parseFloat(arg2);
- 			var r1, r2, m, n;
- 			try {
- 				r1 = arg1.toString().split(".")[1].length
- 			} catch (e) {
- 				r1 = 0
- 			}
- 			try {
- 				r2 = arg2.toString().split(".")[1].length
- 			} catch (e) {
- 				r2 = 0
- 			}
- 			m = Math.pow(10, Math.max(r1, r2));
- 			//动态控制精度长度
- 			n = (r1 >= r2) ? r1 : r2;
- 			return ((this.Mul(arg1, m) - this.Mul(arg2, m)) / m).toFixed(n);
- 		},
- 		//乘法函数,用来得到精确的乘法结果
- 		//说明:javascript的乘法结果会有误差,在两个浮点数相乘的时候会比较明显。这个函数返回较为精确的乘法结果。
- 		//调用:$h.Mul(arg1,arg2)
- 		//返回值:arg1乘以arg2的精确结果
- 		Mul: function(arg1, arg2) {
- 			arg1 = parseFloat(arg1);
- 			arg2 = parseFloat(arg2);
- 			var m = 0,
- 				s1 = arg1.toString(),
- 				s2 = arg2.toString();
- 			try {
- 				m += s1.split(".")[1].length
- 			} catch (e) {}
- 			try {
- 				m += s2.split(".")[1].length
- 			} catch (e) {}
- 			return Number(s1.replace(".", "")) * Number(s2.replace(".", "")) / Math.pow(10, m);
- 		},
- 	},
- 	// 获取地理位置;
- 	$L: {
- 		async getLocation() {
- 			// #ifdef APP-PLUS
- 			let status = await this.checkPermission();
- 			if (status !== 1) {
- 				return;
- 			}
- 			// #endif
- 			// #ifdef MP-WEIXIN || MP-TOUTIAO || MP-QQ
- 			let status = await this.getSetting();
- 			if (status === 2) {
- 				this.openSetting();
- 				return;
- 			}
- 			// #endif
-
- 			this.doGetLocation();
- 		},
- 		doGetLocation() {
- 			uni.getLocation({
- 				success: (res) => {
- 					uni.removeStorageSync('CACHE_LONGITUDE');
- 					uni.removeStorageSync('CACHE_LATITUDE');
- 					uni.setStorageSync('CACHE_LONGITUDE', res.longitude);
- 					uni.setStorageSync('CACHE_LATITUDE', res.latitude);
- 				},
- 				fail: (err) => {
- 					// #ifdef MP-BAIDU
- 					if (err.errCode === 202 || err.errCode === 10003) { // 202模拟器 10003真机 user deny
- 						this.openSetting();
- 					}
- 					// #endif
- 					// #ifndef MP-BAIDU
- 					if (err.errMsg.indexOf("auth deny") >= 0) {
- 						uni.showToast({
- 							title: "访问位置被拒绝"
- 						})
- 					} else {
- 						uni.showToast({
- 							title: err.errMsg
- 						})
- 					}
- 					// #endif
- 				}
- 			})
- 		},
- 		getSetting: function() {
- 			return new Promise((resolve, reject) => {
- 				uni.getSetting({
- 					success: (res) => {
- 						if (res.authSetting['scope.userLocation'] === undefined) {
- 							resolve(0);
- 							return;
- 						}
- 						if (res.authSetting['scope.userLocation']) {
- 							resolve(1);
- 						} else {
- 							resolve(2);
- 						}
- 					}
- 				});
- 			});
- 		},
- 		openSetting: function() {
- 			uni.openSetting({
- 				success: (res) => {
- 					if (res.authSetting && res.authSetting['scope.userLocation']) {
- 						this.doGetLocation();
- 					}
- 				},
- 				fail: (err) => {}
- 			})
- 		}
- 		// async checkPermission() {
- 		// 	let status = permision.isIOS ? await permision.requestIOS('location') :
- 		// 		await permision.requestAndroid('android.permission.ACCESS_FINE_LOCATION');
-
- 		// 	if (status === null || status === 1) {
- 		// 		status = 1;
- 		// 	} else if (status === 2) {
- 		// 		uni.showModal({
- 		// 			content: "系统定位已关闭",
- 		// 			confirmText: "确定",
- 		// 			showCancel: false,
- 		// 			success: function(res) {}
- 		// 		})
- 		// 	} else if (status.code) {
- 		// 		uni.showModal({
- 		// 			content: status.message
- 		// 		})
- 		// 	} else {
- 		// 		uni.showModal({
- 		// 			content: "需要定位权限",
- 		// 			confirmText: "设置",
- 		// 			success: function(res) {
- 		// 				if (res.confirm) {
- 		// 					permision.gotoAppSetting();
- 		// 				}
- 		// 			}
- 		// 		})
- 		// 	}
- 		// 	return status;
- 		// },
- 	}
-
- }

Some files were not shown because too many files changed in this diff