Pārlūkot izejas kodu

Merge branch 'master' of http://git.cc-lotus.info/network/fastNetwork into master

wxy 4 gadi atpakaļ
vecāks
revīzija
b43fa59cfe

+ 5 - 4
app.json

@@ -1,20 +1,21 @@
 {
   "pages": [
-    "pages/exchange/exchange",
-    "pages/user/user",
     "pages/home/home",
-    "pages/card/card",
-    "pages/login/login",
     "pages/perssonal/perssonal",
     "pages/setting/setting",
     "pages/editPwd/editPwd",
     "pages/about/about",
     "pages/news/news",
     "pages/newsDetail/newsDetail",
+    "pages/card/card",
     "pages/team/team",
     "pages/integral/integral",
+    "pages/exchange/exchange",
+    "pages/exchange/exchangeList",
     "pages/car/car",
     "pages/shareholder/shareholder",
+    "pages/user/user",
+    "pages/login/login",
     "pages/index/index",
     "pages/logs/logs",
     "pages/test/test"

+ 27 - 4
pages/exchange/exchange.js

@@ -4,12 +4,35 @@ const app = getApp()
 
 Page({
   data: {
-
+    form: {
+      type: '支付宝',
+      name: '顾红伟',
+      phone: '17319450324',
+      isNum: '100.00',
+    },
+    number: ''
+  },
+  //提交
+  formSubmit: function (e) {
+    let data = this.data.form;
+    data.number = e.detail.value.number;
+    // 判断提现金额是否大于已拥有的金额
+    if (parseFloat(data.number) <= parseFloat(data.isNum)) {
+      // 扣除6%手续费
+      data.number = (data.number - data.number * 0.06).toFixed(2);
+      console.log(data);
+    } else {
+      wx.showToast({
+        title: '输入错误,请重新输入',
+        icon: 'none',
+        duration: 2000
+      })
+    }
   },
-  //事件处理函数
-  bindViewTap: function () {
+  // 兑换记录
+  exchangeList: function () {
     wx.navigateTo({
-      url: '../index/index'
+      url: '/pages/exchange/exchangeList'
     })
   },
   onLoad: function () {

+ 25 - 1
pages/exchange/exchange.wxml

@@ -3,6 +3,30 @@
     积分兑换
   </view>
   <view class="two">
-    积分兑换
+    <form bindsubmit="formSubmit" bindreset="formReset">
+      <view class="twoType">
+        <text>兑换账号</text>
+        <text>{{form.type}}</text>
+      </view>
+      <view class="twoUser">
+        <text>{{form.name}}</text>
+        <text>{{form.phone}}</text>
+      </view>
+      <view class="twojf">
+        <view>输入兑换积分(当前可兑换积分为:<text>{{form.isNum}}</text>)</view>
+        <view>
+          <input type="number" name="number" value="{{number}}" placeholder="请输入兑换积分" />
+        </view>
+      </view>
+      <view class="twoSave">
+        <view>
+          <text>提现需要6%的手续费</text>
+          <text bindtap="exchangeList">兑换记录</text>
+        </view>
+        <view>
+          <button form-type="submit">确认</button>
+        </view>
+      </view>
+    </form>
   </view>
 </view>

+ 109 - 0
pages/exchange/exchange.wxss

@@ -20,4 +20,113 @@
   position: absolute;
   top: 80rpx;
   width: 100%;
+  background-color: #f6f6f6;
+}
+
+.two .twoType {
+  float: left;
+  width: 94%;
+  height: 80rpx;
+  line-height: 80rpx;
+  background-color: #fff;
+  padding: 0 20rpx;
+  margin: 0 0 15rpx 0;
+}
+
+.two .twoType text:nth-child(1) {
+  float: left;
+  width: 20%;
+}
+
+.two .twoType text:nth-child(2) {
+  float: left;
+  width: 80%;
+  text-align: right;
+}
+
+.two .twoUser {
+  float: left;
+  width: 94%;
+  background-color: #fff;
+  padding: 0 20rpx;
+  margin: 0 0 15rpx 0;
+}
+
+.two .twoUser text {
+  float: left;
+  width: 100%;
+  height: 80rpx;
+  line-height: 80rpx;
+  border-bottom: 1px solid #ccc;
+}
+
+.two .twoUser text:nth-child(2) {
+  border-bottom: none;
+}
+
+.two .twojf {
+  float: left;
+  width: 94%;
+  background-color: #fff;
+  padding: 0 20rpx;
+  margin: 0 0 15rpx 0;
+}
+
+.two .twojf view {
+  float: left;
+  width: 100%;
+  height: 80rpx;
+  line-height: 80rpx;
+}
+
+.two .twojf view:nth-child(1) text {
+  color: #ff0000;
+}
+
+.two .twojf view:nth-child(2) {
+  height: 100rpx;
+  line-height: 100rpx;
+}
+
+.two .twojf view:nth-child(2) input {
+  height: 100rpx;
+  line-height: 100rpx;
+}
+
+.two .twoSave {
+  float: left;
+  width: 94%;
+  padding: 0 20rpx 20rpx 20rpx;
+  background-color: #f6f6f6;
+}
+
+.two .twoSave view {
+  float: left;
+  width: 100%;
+}
+
+.two .twoSave view:nth-child(1) {
+  float: left;
+  width: 100%;
+  margin: 0 0 60rpx 0;
+}
+
+.two .twoSave view:nth-child(1) text:nth-child(1) {
+  float: left;
+  width: 80%;
+}
+
+.two .twoSave view:nth-child(1) text:nth-child(2) {
+  float: left;
+  width: 20%;
+  text-align: right;
+  color: #ff0000;
+}
+
+.two .twoSave view button {
+  float: left;
+  width: 100%;
+  background-color: #ff0000;
+  border-radius: 50rpx;
+  color: #fff;
 }

+ 20 - 0
pages/exchange/exchangeList.js

@@ -0,0 +1,20 @@
+//index.js
+//获取应用实例
+const app = getApp()
+
+Page({
+  data: {
+    exchangeList: [
+      {
+        type: '微信',
+        number: '1200.00',
+        create_time: '2020-12-12',
+        status: '已处理',
+      },
+    ]
+  },
+  //提交
+
+  onLoad: function () {
+  },
+})

+ 4 - 0
pages/exchange/exchangeList.json

@@ -0,0 +1,4 @@
+{
+  "component": true,
+  "usingComponents": {}
+}

+ 17 - 0
pages/exchange/exchangeList.wxml

@@ -0,0 +1,17 @@
+<view class="main">
+  <view class="one">
+    兑换记录
+  </view>
+  <view class="two">
+    <view class="list" wx:key="unique" wx:for="{{exchangeList}}" wx:for-item="item">
+      <view class="top">
+        <text>兑换到{{item.type}}</text>
+        <text>{{item.number}}</text>
+      </view>
+      <view class="down">
+        <text>{{item.create_time}}</text>
+        <text>{{item.status}}</text>
+      </view>
+    </view>
+  </view>
+</view>

+ 65 - 0
pages/exchange/exchangeList.wxss

@@ -0,0 +1,65 @@
+.main {
+  float: left;
+  width: 100%;
+  height: 100%;
+  background-color: #f6f6f6;
+}
+
+.main .one {
+  position: fixed;
+  z-index: 9999;
+  width: 100%;
+  height: 80rpx;
+  line-height: 80rpx;
+  background-color: #409eff;
+  color: #ffffff;
+  text-align: center;
+}
+
+.main .two {
+  position: absolute;
+  top: 80rpx;
+  width: 94%;
+  padding: 20rpx;
+  background-color: #f6f6f6;
+}
+
+.main .two .list {
+  float: left;
+  width: 98%;
+  background-color: #fff;
+  margin: 0 0 15rpx 0;
+  padding: 10rpx;
+}
+
+.main .two .list .top {
+  float: left;
+  width: 100%;
+  padding: 0 0 20rpx 0;
+}
+
+.main .two .list .top text {
+  float: left;
+  width: 50%;
+}
+
+.main .two .list .top text:nth-child(2) {
+  text-align: right;
+}
+
+.main .two .list .down {
+  float: left;
+  width: 100%;
+  padding: 0 0 10rpx;
+  color: #666;
+  font-size: 30rpx;
+}
+
+.main .two .list .down text {
+  float: left;
+  width: 50%;
+}
+
+.main .two .list .down text:nth-child(2) {
+  text-align: right;
+}

+ 1 - 1
pages/perssonal/perssonal.wxss

@@ -38,7 +38,7 @@
   text-align: center;
   line-height: 150rpx;
   font-weight: bold;
-  color: #00FF7F;
+  color: #ff0000;
   background: #fff;
   box-shadow: 0 0 5rpx #ccc;
 }

+ 1 - 1
project.config.json

@@ -40,7 +40,7 @@
   },
   "compileType": "miniprogram",
   "libVersion": "2.14.1",
-  "appid": "wxa640bfcd13f4fb16",
+  "appid": "wx2c50f82dae28a9f5",
   "projectname": "fastNetwork",
   "debugOptions": {
     "hidedInDevtools": []