瀏覽代碼

no message

DaMowang 3 年之前
父節點
當前提交
79bb1b83de
共有 5 個文件被更改,包括 147 次插入569 次删除
  1. 3 318
      src/App.vue
  2. 6 6
      src/pages.json
  3. 1 1
      src/pages/index/index.vue
  4. 93 201
      src/pages/product/productRetail.vue
  5. 44 43
      src/utils/highPrecision.js

+ 3 - 318
src/App.vue

@@ -1,7 +1,4 @@
 <script>
-	let util = require('@/utils/utils.js');
-	var registerFlag = true;
-	let crypto = require("crypto");
 	export default {
 		globalData:{
 		    userInfo: {},
@@ -9,28 +6,7 @@
 		        shop_name: "数字茶城",
 		        desc: "数字茶城"
 		    },
-		    kfCode: '',
-			
-			ShopUrl: 'https://shop.haocha13.cn/ShuZiTeaYW/',
-			SignUrl: 'https://shop.haocha13.cn/ShuZiTeaIntegral/',
-			SpecUrl: 'https://shop.haocha13.cn/ShuZiTeaSpecial/',
-			groupUrl:'https://shop.haocha13.cn/ShuZiTeaSpell/', // 团购测试url  tea
-
-			// ShopUrl: 'https://tea.soowin.com/ShuZiTeaYW/',
-			// SignUrl: 'https://tea.soowin.com/ShuZiTeaIntegral/',
-			// SpecUrl: 'https://tea.soowin.com/ShuZiTeaSpecial/',
-			// groupUrl:'https://tea.soowin.com/ShuZiTeaSpell/', // 团购测试url  tea
-
-			// ShopUrl: 'http://192.168.31.176:8080/ShuZiTeaYW/',
-			// SignUrl: 'http://192.168.31.176:8080/ShuZiTeaIntegral/',
-			// SpecUrl: 'http://192.168.31.176:8080/ShuZiTeaSpecial/',
-			// groupUrl:'http://192.168.31.176:8080/ShuZiTeaSpell/', // 团购测试url  tea
-
 		    openId: '',
-		    agentId: 1, //推荐人ID
-		    interfaceheader: {
-		        "Content-Type": "application/x-www-form-urlencoded"
-		    },
 		    authorizeWindow: true, //是否可以打开用户信息授权页面,避免重复打开
 		    bindPhoneWindow: true, //是否可以打开绑定手机号码页面,避免重复打开
 		    hasUpdate: false, // 小程序是否有更新版本 默认为没有
@@ -42,297 +18,6 @@
 		    msgTmp: null ,//订阅消息模板id信息
 			systemUserInfo:''
 		},
-		//检测缓存中是否有当前用户信息
-		authorizeUserInfo: function (callback, isHome) {
-			var that=this
-		    if (this.globalData.systemUserInfo=='') {
-		        uni.getStorage({
-		            key: 'systemUserInfo',
-		            success(res) {
-		                that.globalData.systemUserInfo = res.data;
-		                if (callback) {
-		                    callback(res.data.userId);
-		                }
-		            },
-		            fail() {
-						that.login(callback, isHome);
-		            }
-		        })
-		    } else {
-		        if (callback) {
-		            callback(this.globalData.systemUserInfo.userId);
-		        }
-		    }
-		},
-		login: function(callback, isHome) {
-		    var that = this;
-		    uni.showLoading({
-				icon: 'loading',
-				mask: true
-			});
-			uni.login({
-				provider: 'weixin',
-				success: function (res) {
-					if (res.code) {
-						// console.log(res.code)
-						//查询当前用户openId并返回是否已注册
-						uni.request({
-							//获取openID
-							url: that.globalData.ShopUrl + 'login/openid',
-							method: 'POST',
-							header: that.globalData.interfaceheader,
-							data: {
-								code: res.code
-							},
-							success: function (res) {
-								uni.hideLoading();
-								if (res.data.status == '200' || res.data.status == '300') {
-									that.globalData.openId = res.data.openid;
-									//用户已存在
-									if (res.data.userInfo && res.data.userInfo != ''){
-										that.globalData.systemUserInfo = res.data.userInfo;
-										uni.setStorage({
-											key: 'systemUserInfo',
-											data: res.data.userInfo
-										})
-										if (callback) {
-											callback(res.data.userInfo.userId);
-										}
-									}else{
-										//如果不是首页
-										if (!isHome){
-											//用户不存在
-											if(res.data.status == '300'){
-												let is=1
-												that.sendauthorizeUserInfo(is,callback);
-											}else{
-												let is=1
-												that.sendauthorizeUserInfo(is,callback);
-											}
-										}else{
-											callback();
-										}
-									}
-								} else {
-									console.log("登录" + res.data.status);
-									that.errTips(res.data.msg || "");
-								}
-							}
-						})
-					} else {
-						uni.hideLoading();
-						that.errTips("登录失败,请稍后重试。");
-					}
-				},
-				fail: (err) => {
-					console.log(err)
-				}
-			})
-		},
-		setAppData:function(id,data){
-			this.globalData.systemUserInfo=data
-			this.globalData.openId=id
-		},
-		//发起userInfo授权
-		sendauthorizeUserInfo: function(is,callback) {
-		    var that = this;
-		    //检测当前微信版本是否兼容wx.getUserInfo
-		    if (uni.getSetting) {
-		        uni.getSetting({
-		            success(res) {
-		                if (res.authSetting['scope.userInfo']) {
-							if(is==1){
-								that.setData(callback);
-							}else if(is==2){
-								that.setUnionid(callback)
-							}
-		                } else {
-		                    if (that.globalData.authorizeWindow) {
-		                        uni.navigateTo({
-		                            url: "/pages/authorize/index"
-		                        })
-								
-								that.globalData.authorizeWindow = false;
-		                    }
-		                }
-		            },
-		            fail(res) {
-		                uni.showModal({
-		                    content: "登录失败,请稍后重试。",
-		                    showCancel: false
-		                });
-		            }
-		        })
-		    } else {
-		        // 如果希望用户在最新版本的客户端上体验您的小程序,可以这样提示
-		        that.checkEdition();
-		        return;
-		    }
-		},
-		//微信版本太旧提示
-		checkEdition: function() {
-		    uni.showModal({
-		        title: '微信版本太旧',
-		        content: '使用旧版本微信,将无法登录、使用一些功能。请至 微信 -> 设置 或其他可信渠道更新微信。',
-		        showCancel: false,
-		        confirmColor: "#f02f2f",
-		        confirmText: "好",
-		    })
-		},
-		//发起userInfo授权
-		sendauthorizeUserInfo: function(is,callback) {
-		    var that = this;
-		    //检测当前微信版本是否兼容wx.getUserInfo
-		    if (uni.getSetting) {
-		        uni.getSetting({
-		            success(res) {
-		                if (res.authSetting['scope.userInfo']) {
-							if(is==1){
-								that.setData(callback);
-							}else if(is==2){
-								that.setUnionid(callback)
-							}
-		                } else {
-		                    if (that.globalData.authorizeWindow) {
-		                        uni.navigateTo({
-		                            url: "/pages/authorize/index"
-		                        })
-								
-								that.globalData.authorizeWindow = false;
-		                    }
-		                }
-		            },
-		            fail(res) {
-		                uni.showModal({
-		                    content: "登录失败,请稍后重试。",
-		                    showCancel: false
-		                });
-		            }
-		        })
-		    } else {
-		        // 如果希望用户在最新版本的客户端上体验您的小程序,可以这样提示
-		        that.checkEdition();
-		        return;
-		    }
-		},
-		// 获取data
-		setData(callback){
-		    var that = this;
-		    // 如果改为unionid注册时以下代码加上注释
-		    uni.getUserProfile({
-		        desc: '获取用户注册信息',
-		    	lang:'zh_CN',
-		        success: function (res) {
-		            var userinfo = {
-		                nickname: res.userInfo.nickName ? util.emoji_utf16toEntities(res.userInfo.nickName) : '',
-		                headimgurl: res.userInfo.avatarUrl || '',
-		                sex: res.userInfo.gender == 2 ? '女' : '男',
-		                city: res.userInfo.city || '',
-		                province: res.userInfo.province || '',
-		                country: res.userInfo.country || ''
-		            };
-					console.log(userinfo,"aaaaaaaaa")
-					return
-		            that.globalData.systemUserInfo = userinfo;
-		            var data = {
-		                agentId: that.globalData.agentId,
-		                openid: that.globalData.openId,
-		                ...userinfo
-		            };
-		    		let isdata=1
-		            that.setUnionidApi(data,isdata, callback);
-		        },
-		        fail: function (res) {
-		            console.log(res);
-		        }
-		    })
-		},
-		setUnionid:function(callback){
-			var that=this
-			// 如果改为unionid注册时以下代码去掉注释
-			uni.login({
-			    success: function (obj) {
-			        if (obj.code) {
-			            uni.getUserInfo({
-			                withCredentials: true,
-			                success: function (res) {
-			                    var data = {
-			                        agentId: that.globalData.agentId,
-			                        code: obj.code,
-			                        encryptedData: res.encryptedData,
-			                        iv: res.iv
-			                    };
-			                    let isUnionid=2
-			                    that.setUnionidApi(data,isUnionid, callback);
-			                },
-			                fail: function (res) {
-			                    console.log("unionid授权失败:" + res);
-			                }
-			            })
-			        }else{
-			            console.log("unionid登录code获取失败:" + obj);
-			        }
-			    },
-			    fail: function (obj) {
-			        console.log("unionid登录code获取失败:" + obj);
-			    }
-			})
-		},
-		setUnionidApi(data = this.parameter("data"),is, callback){
-		    var that = this;
-			if(is==1){
-				uni.request({
-				    url: this.globalData.ShopUrl + 'login/data', // 如果改为unionid注册时改回'login/addUnionid'接口
-				    method: 'POST',
-				    header: this.globalData.interfaceheader,
-				    data: data,
-				    success: function (res) {
-				        if (res.data.status == 200) { //登录成功
-				            var userInfo = that.globalData.systemUserInfo;
-				            userInfo = res.data.userInfo;
-				            that.globalData.systemUserInfo = userInfo;
-				            uni.setStorage({
-				                key: 'systemUserInfo',
-				                data: userInfo
-				            })
-				            if (callback) {
-				                callback(userInfo.userId);
-				            }
-				        } else {
-				            uni.hideLoading();
-				            console.log(res.data.msg || "保存信息接口失败");
-				        }
-				    }
-				})
-			}else if(is==2){
-				uni.request({
-				    url: this.globalData.miniShopUrl + 'login/addUnionid', 
-				    method: 'POST',
-				    header: this.globalData.interfaceheader,
-				    data: data,
-				    success: function (res) {
-				        if (res.data.status == 200) { //登录成功
-				            var userInfo = that.globalData.systemUserInfo;
-				            userInfo = res.data.userInfo;
-				            that.globalData.systemUserInfo = userInfo;
-				            // var userinfo = res.data.userInfo;
-				            // that.globalData.systemUserInfo = userinfo;
-				            uni.setStorage({
-				                key: 'systemUserInfo',
-				                data: userInfo
-				            })
-				            if (callback) {
-				                callback(userInfo.userId);
-				            }
-				        } else {
-				            uni.hideLoading();
-				            console.log(res.data.msg||"保存unionid接口失败");
-				            // console.log(res.data.msg || "保存信息接口失败");
-				        }
-				    }
-				})
-			}
-		},
 		errTips(msg, duration, open){
 		    uni.showToast({
 		        title: msg,
@@ -345,16 +30,16 @@
 		parameter(authName) {
 		    throw new Error("'" + authName + "' cat\'t be empty!");
 		},
-		onLaunch: function() {
+		onLaunch() {
 			var logs = uni.getStorageSync('logs') || []
 			logs.unshift(Date.now())
 			uni.setStorageSync('logs', logs);
 			uni.setStorageSync('mallName', "数字茶城");
 		},
-		onShow: function() {
+		onShow() {
 			console.log('App Show')
 		},
-		onHide: function() {
+		onHide() {
 			console.log('App Hide')
 		}
 	}

+ 6 - 6
src/pages.json

@@ -277,12 +277,12 @@
 			}
 		 ]
 	}],
-	"preloadRule": {
-		"pages/index/index": {
-			"network": "all",
-			"packages": ["pagesB"]
-		}
-	},
+	// "preloadRule": {
+	// 	"pages/index/index": {
+	// 		"network": "all",
+	// 		"packages": ["pagesB"]
+	// 	}
+	// },
 	"tabBar": {
 		"color": "#505050",
 		"selectedColor": "#12B280",

+ 1 - 1
src/pages/index/index.vue

@@ -59,8 +59,8 @@
                         <view class="product-txt">赠送{{ i.give_integral ? i.give_integral + "批发积分" : i.give_cha_bao + "茶宝" }}</view>
                     </view>
                 </view>
-                <view class="fz_w_text mar_t20 mar_b20">让数字经济赋能美好生活!</view>
             </view>
+            <view class="fz_w_text mar_t20 mar_b20">让数字经济赋能美好生活!</view>
         </view>
     </div>
 </template>

+ 93 - 201
src/pages/product/productRetail.vue

@@ -1,18 +1,24 @@
 <template>
     <view class="container">
-        <!-- 商品列表 -->
-        <view class="goods_con flex_r flex_ac flex_wrap">
-            <view class="goods" v-for="(item,index) in goods" :key="index" @tap="NavToGoodsDetail(item.id)">
-                <image class="goods_img" :src="item.original_img" mode=""></image>
-                <view class="goods_info">
-                    <view class="info_title ellipsis2">{{item.goods_name}}</view>
-                    <view class="info_option flex_r flex_ac flex_jb">
-                        <view class="info_price"><text>¥</text>{{item.price}}</view>
+        
+        <view class="product-list">
+            <view class="product" v-for="(i, s) in goods" :key="s" @click="NavToGoodsDetail(i.id)">
+                <view class="image-view">
+                    <image class="product-image" :src="i.original_img"></image>
+                </view>
+                <view class="content-view">
+                    <view :class="['product-title', 'ellipsis1']">{{ i.goods_name }}</view>
+                    <view class="product-price">
+                        <text class="product-price-original"><text class="product-unit">¥</text>{{ i.price }}</text>
+                        <text class="product-price-favour">¥{{i.cost_price}}</text>
+                        <!-- <text class="product-tip">{{i.tip}}</text> -->
                     </view>
-                    <view class="info_hint" v-if="type != 6">赠送{{item.give_integral ? item.give_integral + '批发积分' : item.give_cha_bao + '茶宝'}}</view>
+                    <view class="product-txt" v-if="type != 6">赠送{{ i.give_integral ? i.give_integral + "批发积分" : i.give_cha_bao + "茶宝" }}</view>
+                    <view class="product-txt" v-else>每{{i.interval_time}}分钟降价{{i.drop_range * 100}}%</view>
                 </view>
             </view>
         </view>
+
         <!-- 商品列表-end -->
       <not-goods v-if="haveGoods" textStr="暂无商品信息"></not-goods>
     </view>
@@ -124,198 +130,84 @@ page {
 // 页面配置-end
 
 // 商品列表
-.goods:nth-child(2n) {
-    margin-right: 0;
-}
-
-.info_cart {
-    width: 46rpx;
-    height: 45rpx;
-}
-
-.goods_con {
-    width: 100%;
-    overflow: hidden;
-}
-
-.info_hint {
-    font-size: 22rpx;
-    color: #787878;
-}
-
-.info_option {
-    width: 100%;
-    overflow: hidden;
-}
-
-.goods_img {
-    width: 100%;
-    height: 41vw;
-    display: block;
-}
-
-.info_msg {
-    font-size: 24rpx;
-    color: #787878;
-    margin-top: 8rpx;
-}
-
-.goods_info {
-    padding: 20rpx 16rpx;
-    width: 100%;
-    box-sizing: border-box;
-}
-
-.info_price {
-    font-size: 32rpx;
-    color: #18BB87;
-    font-family: "SourceHanSansCN-Bold";
-}
-
-.info_title {
-    font-size: 28rpx;
-    color: #1B1A1A;
-    font-family: "SourceHanSansCN-Bold";
-    font-weight: bold;
-}
-
-.info_price text {
-    font-size: 22rpx;
-    color: #18BB87;
-    font-family: "SourceHanSansCN-Bold";
-    font-weight: bold;
-}
-
-.goods {
-    width: 48%;
-    overflow: hidden;
-    margin-right: 22rpx;
-    margin-bottom: 22rpx;
-    background: #fff;
-    border-radius: 12rpx;
-}
-
-// 商品列表-end
-
-// 购买或加入购物车弹窗
-.option_box text {
-    color: #2DB389;
-}
-
-.goods_raido {
-    margin-right: 180rpx;
-}
-
-.close_img {
-    width: 36rpx;
-    height: 36rpx;
-}
-
-.option_box {
-    font-size: 26rpx;
-    margin-top: 80rpx;
-}
-
-.goods_raido:nth-last-child(1) {
-    margin-right: 0;
-}
-
-.num_con {
-    width: 100%;
-    overflow: hidden;
-    padding-bottom: 3rpx;
-}
-
-.goods_option {
-    width: 100%;
-    overflow: hidden;
-    padding-top: 50rpx;
-}
-
-.close_con {
-    width: 100%;
-    overflow: hidden;
-    margin-bottom: 35rpx;
-}
-
-.raido_text {
-    font-size: 26rpx;
-    color: #545454;
-    margin-left: 30rpx;
-}
-
-.goods_cons {
-    width: calc(100% - 202rpx - 30rpx);
-    overflow: hidden;
-}
-
-.goods_imgs {
-    width: 202rpx;
-    height: 187rpx;
-    margin-right: 30rpx;
-    border-radius: 12rpx;
-}
-
-.confim {
+.product-list {
+    padding: 0 20rpx;
+    display: flex;
     width: 100%;
-    height: 80rpx;
-    border-radius: 40rpx;
-    background: #2DB389;
-    color: #fff;
-    font-size: 26rpx;
-    margin-top: 44rpx;
-}
-
-.shopping {
-    width: 100%;
-    overflow: hidden;
-    padding: 20rpx;
-    box-sizing: border-box;
-    border-radius: 30rpx 30rpx 0 0;
-    background: #fff;
-}
-
-.goods_infos {
-    width: 100%;
-    overflow: hidden;
-    align-items: inherit;
-    padding-bottom: 48rpx;
-    border-bottom: 3rpx solid rgba(0, 0, 0, .12);
-}
-
-.shop_names {
-    width: 100%;
-    overflow: hidden;
-    font-family: "SourceHanSansCN-Bold";
-    font-weight: bold;
-    color: #1B1B1B;
-    font-size: 32rpx;
-}
-
-.goods_msg {
-    width: 100%;
-    overflow: hidden;
-    font-size: 28rpx;
-    color: #18BB88;
-    font-family: "SourceHanSansCN-Medium";
-    font-weight: 500;
-}
-
-.raido_img {
-    width: 39rpx;
-    height: 35rpx;
-    background: url(~@/static/img/weixuanzhong.png);
-    background-repeat: no-repeat;
-    background-size: 35rpx 35rpx;
-    background-position: center center;
-}
-
-.raido_box {
-    background: url(~@/static/img/consent.png);
-    background-repeat: no-repeat;
-    background-size: 39rpx 35rpx;
-    background-position: center center;
+    flex-wrap: wrap;
+    flex-direction: row;
+
+    .product {
+        // width: 50%;
+        // padding: 20rpx 10rpx;
+        display: flex;
+        flex-direction: column;
+
+        margin-bottom: 20rpx;
+        width: 48.5%;
+        padding-bottom: 6px;
+        // border: 1px solid #eee;
+        border-radius: 5px;
+        box-shadow: 4rpx 4rpx 26rpx 2rpx rgba(17, 18, 29, 0.08);
+
+        &:nth-child(2n) {
+            margin-left: 3%;
+        }
+    }
+
+    .product-image {
+        border-radius: 10rpx 10rpx 0 0;
+        width: 100%;
+        height: 42.3vw;
+        object-fit: cover;
+    }
+
+    .content-view{
+        padding: 0 16rpx;
+    }
+
+    .product-title {
+        width: 100%;
+        overflow: hidden;
+        line-height: 1.5;
+        font-size: 28rpx;
+        color: #121212;
+    }
+
+    .product-price {
+        color: #121212;
+        font-size: 28rpx;
+        position: relative;
+    }
+
+    .product-price-original {
+        color: #18bb88;
+        font-size: 32rpx;
+    }
+
+    .product-price-favour {
+        color: #888888;
+        text-decoration: line-through;
+        margin-left: 10upx;
+    }
+
+    .product-tip {
+        position: absolute;
+        right: 10upx;
+        background-color: #ff3333;
+        color: #ffffff;
+        padding: 0 10upx;
+        border-radius: 5upx;
+    }
+
+    .product-unit {
+        font-size: 24rpx;
+        color: #18bb88;
+    }
+
+    .product-txt {
+        font-size: 22rpx;
+        color: #787878;
+    }
 }
-
-// 购买或加入购物车弹窗-end
 </style>

+ 44 - 43
src/utils/highPrecision.js

@@ -1,45 +1,46 @@
 export default {
-    //加法函数
-    Add: function(arg1, arg2) {
-       let 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}
-       // 计算底数为10以最大小数位数为次幂的值
-       m=Math.pow(10,Math.max(r1,r2));
-       // 把所有参数转为整数后相加再除以次幂的值
-       return (arg1*m + arg2*m)/m;
-    },
-    //减法函数
-    Sub: function(arg1, arg2) {
-       let 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}
-       // 计算底数为10以最大小数位数为次幂的值
-       m=Math.pow(10,Math.max(r1,r2));
-       //精度长度以最大小数位数为长度
-       n=(r1>=r2)?r1:r2;
-       return ((arg1*m-arg2*m)/m).toFixed(n);
-    },
-    //乘法函数
-    Mul: function(arg1, arg2) {
-       let m=0,s1=arg1.toString(),s2=arg2.toString();
-       // 获取所有参数小数位长度之和
-       try{m+=s1.split(".")[1].length}catch(e){}
-       try{m+=s2.split(".")[1].length}catch(e){}
-       // 替换掉小数点转为数字相乘再除以10的次幂值
-       return Number(s1.replace(".",""))*Number(s2.replace(".",""))/Math.pow(10,m);
-    },
-    //除法函数
-    Div: function(arg1, arg2) {
-       let 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 (r1/r2)*Math.pow(10,t2-t1);
-    },
+   //加法函数
+   Add: function(arg1, arg2) {
+      let 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}
+      // 计算底数为10以最大小数位数为次幂的值
+      m=Math.pow(10,Math.max(r1,r2));
+      // 把所有参数转为整数后相加再除以次幂的值
+      return (arg1*m + arg2*m)/m;
+   },
+   //减法函数
+   Sub: function(arg1, arg2) {
+      let 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}
+      // 计算底数为10以最大小数位数为次幂的值
+      m=Math.pow(10,Math.max(r1,r2));
+      //精度长度以最大小数位数为长度
+      n=(r1>=r2)?r1:r2;
+      return ((arg1*m-arg2*m)/m).toFixed(n);
+   },
+   //乘法函数
+   Mul: function(arg1, arg2) {
+      console.log(arg1 instanceof Number);
+      let m=0,s1=arg1.toString(),s2=arg2.toString();
+      // 获取所有参数小数位长度之和
+      try{m+=s1.split(".")[1].length}catch(e){}
+      try{m+=s2.split(".")[1].length}catch(e){}
+      // 替换掉小数点转为数字相乘再除以10的次幂值
+      return Number(s1.replace(".",""))*Number(s2.replace(".",""))/Math.pow(10,m);
+   },
+   //除法函数
+   Div: function(arg1, arg2) {
+      let 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 (r1/r2)*Math.pow(10,t2-t1);
+   },
 }