邪性 3 жил өмнө
parent
commit
f03473815b

+ 4 - 1
app.json

@@ -1,8 +1,11 @@
 {
   "pages":[
     "pages/index/index",
+    "pages/template/index",
     "pages/add/index",
-    "pages/login/index"
+    "pages/try/index",
+    "pages/login/index",
+    "pages/accessory/index"
   ],
   "tabBar": {
     "list": [{

BIN
assets/accessory/upload.png


BIN
assets/accessory/upload2.png


+ 83 - 0
pages/accessory/index.js

@@ -0,0 +1,83 @@
+Page({
+  data: {
+    uploadImg: "../../assets/accessory/upload.png",
+    value: [
+      {
+        name: "身份证",
+        maxlen: 2,
+        value: [{ name: "正面", meg: "证件照模糊不清!", value: "https://ossweb-img.qq.com/images/lol/web201310/skin/big10006.jpg" }, { name: "反面", value: "https://ossweb-img.qq.com/images/lol/web201310/skin/big10006.jpg" }],
+      },
+      {
+        name: "驾驶证",
+        maxlen: 2,
+        value: [{ name: "正面", value: "https://ossweb-img.qq.com/images/lol/web201310/skin/big10006.jpg" },
+        { name: "反面", novalue: true, value: "../../assets/accessory/upload2.png" }],
+      },
+      {
+        name: "收入类",
+        value: [{ value: "https://ossweb-img.qq.com/images/lol/web201310/skin/big10006.jpg" }],
+      },
+      {
+        name: "半年流水",
+        value: [{ meg: "重影严重", value: "https://ossweb-img.qq.com/images/lol/web201310/skin/big10006.jpg" }],
+      },
+      {
+        name: "营业执照",
+        value: [{ value: "https://ossweb-img.qq.com/images/lol/web201310/skin/big10006.jpg" }],
+      },
+      {
+        name: "挂靠协议",
+        value: [{ value: "https://ossweb-img.qq.com/images/lol/web201310/skin/big10006.jpg" }],
+      },
+    ],
+  },
+  // 查看
+  seeFunc (e) { wx.previewImage({ current: e.currentTarget.dataset.url, urls: [e.currentTarget.dataset.url] }) },
+
+  //修改
+  updateFunc (e) {
+    console.log(e.currentTarget.dataset);
+    this.photoAblum();
+  },
+
+  // 添加
+  addFunc (e) {
+    console.log(e.currentTarget.dataset)
+    this.photoAblum();
+  },
+
+  // 证件照来源
+  photoAblum () {
+    wx.chooseImage({
+      sizeType: ['original', 'compressed'], // 可以指定是原图还是压缩图,默认二者都有
+      sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有
+      success: function (res) {
+        console.log(res)
+
+      }
+    })
+  },
+
+
+  onLoad: function (options) {
+
+  },
+  onReady: function () {
+
+  },
+  onShow: function () {
+
+  },
+  onHide: function () {
+
+  },
+  onUnload: function () {
+
+  },
+  onPullDownRefresh: function () {
+
+  },
+  onReachBottom: function () {
+
+  }
+})

+ 4 - 0
pages/accessory/index.json

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

+ 35 - 0
pages/accessory/index.wxml

@@ -0,0 +1,35 @@
+<cu-custom bgColor="bg-gradual-blue" isBack>
+  <view slot="backText">返回</view>
+  <view slot="content">附件</view>
+</cu-custom>
+<view class="section">
+  <view wx:for="{{value}}" wx:key="index" class="item margin-bottom-lg">
+    <view class="cu-bar bg-white solid-bottom">
+      <view class='action'>
+        <text class='cuIcon-titles text-orange '></text> {{item.name}}
+      </view>
+    </view>
+    <!-- 图片列 -->
+    <view bindtap="seeFunc" data-url="{{it.value}}" wx:for="{{item.value}}" wx:for-item="it" wx:for-index="ind"
+      wx:key="ind" class="bg-img bg-mask padding-tb-xl {{ind==0 ?'' : 'margin-top'}}"
+      style="background-image: url({{it.value}});background-size: auto 414rpx;height: 414rpx;">
+      <view class="padding-xl text-white">
+        <view wx:if="{{it.name}}" class="padding-xs text-xl">
+          {{it.name}}
+        </view>
+        <view wx:if="{{it.meg}}" class="padding-xs">
+          {{it.meg}}
+        </view>
+        <view class="btns text-right">
+          <button data-item="{{it}}" catchtap="updateFunc" class="cu-btn rount bg-blue">{{it.novalue ? '上传' :
+            "修改"}}</button>
+        </view>
+      </view>
+    </view>
+    <!-- 添加 -->
+    <view bindtap="addFunc" data-index="{{index}}" wx:if="{{ !item.maxlen}}" class="margin-top bg-white text-center"
+      style="height: 414rpx;">
+      <image style="width: 100px;height: 414rpx;" mode="aspectFit" src="{{uploadImg}}" />
+    </view>
+  </view>
+</view>

+ 1 - 0
pages/accessory/index.wxss

@@ -0,0 +1 @@
+/* pages/accessory/index.wxss */

+ 6 - 6
pages/add/config.js

@@ -26,7 +26,7 @@ const value = [
     //0中国大陆(内地)1中国香港 2中国台湾 3中国澳门 4外国籍
     { name: "nationality", title: "国籍/地区", type: 'switch', value: '' },
     //0身份证 1护照 2军官证 3户口 4临时身份证 5港澳台通行证
-    { name: "itype", title: "身份证件类型", type: 'switch', value: '' },
+    { name: "ntype", title: "身份证件类型", type: 'switch', value: '' },
     { name: "inumber", title: "身份证件号码", _type: "idcard", reg: /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/, value: '' },
     // 0未婚 1已婚 2离异 3丧偶 4其他
     { name: "mstatus", title: "婚姻状况", type: 'switch', value: '' },
@@ -50,11 +50,11 @@ const value = [
     { name: "otype", title: "职业类型", type: "switch", value: "" },
     { name: "position", title: "职位", value: "" },
     // 0是 1否
-    { name: "wbst", title: "是否挂靠", type: "switch", value: "" },
-    { name: "bstname", for: 'wbst', title: "挂靠公司名称", value: "" },
-    { name: "bstcode", for: 'wbst', title: "挂靠公司组织机构代码", value: "" },
-    { name: "bsttel", for: 'wbst', title: "挂靠公司电话", reg: /^(13[0-9]|14[5|7]|15[0|1|2|3|4|5|6|7|8|9]|18[0|1|2|3|5|6|7|8|9])\d{8}$/, value: "" },
-    { name: "bstaddress", for: 'wbst', title: "挂靠公司地址", value: "" }
+    { name: "wbst", forlen: 4, title: "是否挂靠", type: "switch", value: 1 },
+    { name: "bstname", for: 'wbst', norequire: true, title: "挂靠公司名称", value: "" },
+    { name: "bstcode", for: 'wbst', norequire: true, title: "挂靠公司组织机构代码", value: "" },
+    { name: "bsttel", for: 'wbst', norequire: true, title: "挂靠公司电话", reg: /^(13[0-9]|14[5|7]|15[0|1|2|3|4|5|6|7|8|9]|18[0|1|2|3|5|6|7|8|9])\d{8}$/, value: "" },
+    { name: "bstaddress", for: 'wbst', norequire: true, title: "挂靠公司地址", value: "" }
   ],
 
   // 紧急联系人信息

+ 47 - 9
pages/add/index.js

@@ -1,6 +1,7 @@
 import { value, switchs, date } from "./config"
 const app = getApp();
 Page({
+  _value: value,
   data: {
     CustomBar: app.globalData.CustomBar,
     value,
@@ -10,26 +11,58 @@ Page({
     switchB: false,
     endDate: date(),
     switchs,
+    submitLock: false,
+    saveLock: false,
   },
+
+  // 错误提示框
+  errorConfirmFunc () { },
+
   // 提交
   submitFunc () {
-    let { value } = this.data, msgs = [], data = {};
-    value = value[2][6]['value'] == 0 ? [...value[0], ...value[1], ...value[2]] : [...value[0], ...value[1], ...value[2], ...value[3]];
-    console.log(value)
-    value.forEach(item => {
+    let { value, submitLock } = this.data, megs = [], data = {}, _value = this._value;
+    if (submitLock) return false;
+    this.setData({ submitLock: true });
+    if (value[2][6]['value'] == 0) {
+      value = [...value[0], ...value[1], ...value[2]];
+      _value = [..._value[0], ..._value[1], ..._value[2]];
+    } else {
+      value = [...value[0], ...value[1], ...value[2], ...value[3]];
+      _value = [..._value[0], ..._value[1], ..._value[2], ..._value[3]];
+    }
+    value.forEach((item, index) => {
+      // 特殊格式  非必须
+      if (!item.hasOwnProperty('value') || item.norequire) {
+        if (item.hasOwnProperty('value')) data[item.name] = item.value;
+        return false
+      };
+      // 正常流程
       // 判断是否为空
-      if (!item.value) { msgs.push(`${item.title}不能为空!`); return false; };
+      if (!item.value) { megs.push(`${item.title}不能为空!`); return false; };
       // 数字类型
-      if (item.type == 'number' && !/^\d+.?\d*$/.test(item.value)) { msgs.push(`${item.title}必须是数字!`); return false; }
+      if (item.type == 'number' && !/^\d+.?\d*$/.test(item.value)) { megs.push(`${item.title}必须是数字!`); return false; }
       // 正则判断
-      console.log(item)
-      if (item.reg && item.reg.test(item.value)) { msgs.push(`${item.title}格式不正确!`); return false; };
+      if (_value[index].reg && !_value[index].reg.test(item.value)) {
+        megs.push(`${item.title}格式不正确!`); return false;
+      };
       data[item.name] = item.value;
     })
+    if (megs.length != 0) {
+      this.setData({ errorShow: true, megs, submitLock: false });
+      return false;
+    };
     console.log(data);
-    console.log(msgs);
 
   },
+
+  // 保存
+  saveFunc () {
+    let { value, saveLock } = this.data, data = {};
+    value = [...value[0], ...value[1], ...value[2], ...value[3]];
+    value.forEach(item => { if (item.hasOwnProperty('value')) data[item.name] = item.value });
+    console.log(data)
+  },
+
   // 输入
   inputFunc (e) {
     let { value } = this.data, { index } = e.currentTarget.dataset;
@@ -57,6 +90,11 @@ Page({
     let { activeIndex, value } = this.data;
     let _value = e.detail.value * 1;
     value[activeIndex[0]][activeIndex[1]]['value'] = _value;
+    if (value[activeIndex[0]][activeIndex[1]].hasOwnProperty('forlen')) {
+      for (let i = 1; i < (value[activeIndex[0]][activeIndex[1]]['forlen'] + 1); i++) {
+        value[activeIndex[0]][(activeIndex[1] + i)]['norequire'] = _value == 0 ? false : true;
+      }
+    }
     this.setData({ value })
   },
   // 日期

+ 1 - 0
pages/add/index.json

@@ -2,6 +2,7 @@
   "usingComponents": {
     "van-goods-action-icon": "@vant/weapp/goods-action-icon/index",
     "van-goods-action": "@vant/weapp/goods-action/index",
+    "van-dialog": "@vant/weapp/dialog/index",
   "van-goods-action-button": "@vant/weapp/goods-action-button/index"
   }
 }

+ 23 - 11
pages/add/index.wxml

@@ -12,14 +12,15 @@
     </view>
   </view>
   <!--form框类型奇特  特殊处理 除开发人员或者经验娴熟的人,其余不建议修改-->
-  <view wx:for="{{value[0]}}" wx:key="index" data-index="{{[0,index]}}" class="cu-form-group"
+  <view wx:for="{{value[0]}}" wx:key="index" data-index="{{[0,index]}}"
+    class="cu-form-group {{(item.for && item.norequire) ? 'hide' :'show'}}"
     bindtap="{{item.type=='switch' ? 'switchFunc' : ''}}">
     <!-- 没有输入意义的行 -->
     <view wx:if="{{item.style}}" class="title">{{item.title}}</view>
     <!-- 输入行 -->
     <block wx:elif="{{item.type=='picker'}}">
       <view class="title">{{item.title}}</view>
-      <picker class="picker" style="height:100rpx;line-height: 100rpx;" mode="date" value="{{item.value}}"
+      <picker class="picker" style="height:80rpx;line-height: 80rpx;" mode="date" value="{{item.value}}"
         data-index="{{[0,index]}}" start="1900-01-01" end="{{endDate}}" bindchange="DateChange">
         <view class="picker">
           {{item.value}}
@@ -49,14 +50,15 @@
   </view>
 
   <!--form框类型奇特  特殊处理 除开发人员或者经验娴熟的人,其余不建议修改-->
-  <view wx:for="{{value[1]}}" wx:key="index" data-index="{{[1,index]}}" class="cu-form-group"
+  <view wx:for="{{value[1]}}" wx:key="index" data-index="{{[1,index]}}"
+    class="cu-form-group {{(item.for && item.norequire) ? 'hide' :'show'}}"
     bindtap="{{item.type=='switch' ? 'switchFunc' : ''}}">
     <!-- 没有输入意义的行 -->
     <view wx:if="{{item.style}}" class="title">{{item.title}}</view>
     <!-- 输入行 -->
     <block wx:elif="{{item.type=='picker'}}">
       <view class="title">{{item.title}}</view>
-      <picker class="picker" style="height:100rpx;line-height: 100rpx;" mode="date" value="{{item.value}}"
+      <picker class="picker" style="height:80rpx;line-height: 80rpx;" mode="date" value="{{item.value}}"
         data-index="{{[1,index]}}" start="1900-01-01" end="{{endDate}}" bindchange="DateChange">
         <view class="picker">
           {{item.value}}
@@ -86,14 +88,15 @@
   </view>
 
   <!--form框类型奇特  特殊处理 除开发人员或者经验娴熟的人,其余不建议修改-->
-  <view wx:for="{{value[2]}}" wx:key="index" data-index="{{[2,index]}}" class="cu-form-group"
+  <view wx:for="{{value[2]}}" wx:key="index" data-index="{{[2,index]}}"
+    class="cu-form-group {{(item.for && item.norequire) ? 'hide' :'show'}}"
     bindtap="{{item.type=='switch' ? 'switchFunc' : ''}}">
     <!-- 没有输入意义的行 -->
     <view wx:if="{{item.style}}" class="title">{{item.title}}</view>
     <!-- 输入行 -->
     <block wx:elif="{{item.type=='picker'}}">
       <view class="title">{{item.title}}</view>
-      <picker class="picker" style="height:100rpx;line-height: 100rpx;" mode="date" value="{{item.value}}"
+      <picker class="picker" style="height:80rpx;line-height: 80rpx;" mode="date" value="{{item.value}}"
         data-index="{{[2,index]}}" start="1900-01-01" end="{{endDate}}" bindchange="DateChange">
         <view class="picker">
           {{item.value}}
@@ -123,13 +126,14 @@
   </view>
   <!--form框类型奇特  特殊处理 除开发人员或者经验娴熟的人,其余不建议修改-->
   <view wx:if="{{value[2][6]['value']==1}}" wx:for="{{value[3]}}" wx:key="index" data-index="{{[3,index]}}"
-    class="cu-form-group" bindtap="{{item.type=='switch' ? 'switchFunc' : ''}}">
+    class="cu-form-group {{(item.for && item.norequire) ? 'hide' :'show'}}"
+    bindtap="{{item.type=='switch' ? 'switchFunc' : ''}}">
     <!-- 没有输入意义的行 -->
     <view wx:if="{{item.style}}" class="title">{{item.title}}</view>
     <!-- 输入行 -->
     <block wx:elif="{{item.type=='picker'}}">
       <view class="title">{{item.title}}</view>
-      <picker class="picker" style="height:100rpx;line-height: 100rpx;" mode="date" value="{{item.value}}"
+      <picker class="picker" style="height:80rpx;line-height: 80rpx;" mode="date" value="{{item.value}}"
         data-index="{{[3,index]}}" start="1900-01-01" end="{{endDate}}" bindchange="DateChange">
         <view class="picker">
           {{item.value}}
@@ -152,7 +156,7 @@
 <!-- 功能栏 -->
 <van-goods-action>
   <van-goods-action-button type="warning" bind:click="saveFunc" text="保存" />
-  <van-goods-action-button bind:click="submitFunc" text="提交" />
+  <van-goods-action-button loading="{{submitLock}}" bind:click="submitFunc" text="提交" />
 </van-goods-action>
 
 <!-- 单选 -->
@@ -165,11 +169,19 @@
           <view class="cu-item" wx:for="{{switchs[active]}}" wx:key="index">
             <label class="flex justify-between align-center flex-sub">
               <view class="flex-sub">{{item}}</view>
-              <radio value="{{index}}" class="round"></radio>
+              <radio value="{{index}}" checked="{{value[activeIndex[0]][activeIndex[1]]['value']===index}}"
+                class="round"></radio>
             </label>
           </view>
         </view>
       </radio-group>
     </scroll-view>
   </view>
-</view>
+</view>
+
+<!-- 错误提示框 -->
+<van-dialog use-slot title="提示" show="{{ errorShow }}" confirmText="关闭" bind:confirm="errorConfirmFunc">
+  <scroll-view scroll-y style="max-height:50vh;">
+    <view wx:for="{{megs}}" wx:key="index" class="margin-sm">{{index+1}}、 {{item}}</view>
+  </scroll-view>
+</van-dialog>

+ 36 - 24
pages/add/index.wxss

@@ -1,30 +1,42 @@
 /* 开发者 */
-.header{
-  display: flex;
-  align-items: center;
-  line-height: 60rpx;
-  font-size: 32rpx;
-  background-color: #fff;
-}
 .section{
   margin-bottom: 50px;
 }
-.section picker::after{
+
+.section .title{
+  font-size: 32rpx;
+}
+
+.section .cu-form-group{
+  min-height: 80rpx;
+}
+
+.cu-form-group picker .picker{
+  line-height: 80rpx;
+}
+
+.section .picker::after{
   font-family: "cuIcon";
-    display: block;
-    content: "\e6a3";
-    position: absolute;
-    font-size: 34rpx;
-    color: var(--grey);
-    line-height: 100rpx;
-    width: 60rpx;
-    text-align: center;
-    top: 0;
-    bottom: 0;
-    right: -20rpx;
-    margin: auto;
-    margin-top: auto;
-    margin-right: auto;
-    margin-bottom: auto;
-    margin-left: auto;
+  display: block;
+  content: "\e6a3";
+  position: absolute;
+  font-size: 26rpx;
+  color: #666;
+  line-height: 80rpx;
+  width: 60rpx;
+  text-align: center;
+  top: 0;
+  bottom: 0;
+  right: -18rpx;
+  margin: auto;
+  margin-top: auto;
+  margin-right: auto;
+  margin-bottom: auto;
+  margin-left: auto;
+}
+
+
+
+.section .hide{
+  display: none;
 }

+ 1 - 1
pages/index/index.js

@@ -11,7 +11,7 @@ Page({
     // 商品
     value: [
       { img: "https://ossweb-img.qq.com/images/lol/web201310/skin/big10006.jpg", title: "钢铁之翼", detail: "Only the guilty need fear me." },
-      { img: "https://yz.lol.qq.com/v1/assets/videos/aatrox-splashvideo.webm", title: "暗裔剑魔", detail: "我必须连同希望一起毁坏……" },
+      { img: "https://ossweb-img.qq.com/images/lol/web201310/skin/big10006.jpg", title: "暗裔剑魔", detail: "我必须连同希望一起毁坏……" },
       { img: "https://ossweb-img.qq.com/images/lol/web201310/skin/big10006.jpg", title: "钢铁之翼", detail: " Only the guilty need fear me." },
       { img: "https://ossweb-img.qq.com/images/lol/web201310/skin/big10006.jpg", title: "钢铁之翼", detail: " Only the guilty need fear me." },
       { img: "https://ossweb-img.qq.com/images/lol/web201310/skin/big10006.jpg", title: "钢铁之翼", detail: " Only the guilty need fear me." },

+ 8 - 2
pages/login/index.js

@@ -8,12 +8,18 @@ Page({
     },
     // 列表
     items: [
-      { imgurl: 'punch', title: "草稿箱" },
-      { imgurl: 'form', title: "已填报" }
+      { imgurl: 'punch', title: "草稿箱", require: true, success () { wx.navigateTo({ url: '/pages/template/index?data=drafts', }) } },
+      { imgurl: 'form', title: "已填报", require: true, success () { wx.navigateTo({ url: '/pages/template/index?data=provided', }) } }
     ],
     update_lock: false,//更新资料按钮锁
     subscriber_lock: false,//订阅消息按钮锁
   },
+
+  // 功能事件
+  onClickFunc (e) {
+    let { index } = e.currentTarget.dataset, { items } = this.data;
+    items[index]['success'].bind(this)();
+  },
   onLoad: function (options) {
 
   },

+ 1 - 1
pages/login/index.wxml

@@ -16,7 +16,7 @@
     </view>
   </view>
   <view class="cu-list menu margin-bottom-xl shadow-lg radius">
-    <view wx:for="{{items}}" wx:key="index" class="cu-item arrow">
+    <view bindtap="onClickFunc" data-index="{{index}}" wx:for="{{items}}" wx:key="index" class="cu-item arrow">
       <view class="content" bindtap="CopyLink" data-link="https://github.com/weilanwl/ColorUI">
         <text class="cuIcon-{{item.imgurl}} text-blue"></text>
         <text class="text-black">{{item.title}}</text>

+ 74 - 0
pages/template/index.js

@@ -0,0 +1,74 @@
+Page({
+  data: {
+    value: [
+      {
+        name: "张三",
+        tel: "15793329457",
+        vmodel: "福田奥铃捷运冷藏",
+        invioce: 19000,
+        lamount: 15000,
+        laompany: "sp-等额本息-LcV12.99%-个人-36msp-等额本息-LcV12.99%-个人-36msp-等额本息-LcV12.99%-个人-36msp-等额本息-LcV12.99%-个人-36m",
+        type: "草稿"
+      },
+      {
+        name: "张三",
+        tel: "15793329457",
+        vmodel: "福田奥铃捷运冷藏",
+        invioce: 19000,
+        lamount: 15000,
+        laompany: "sp-等额本息-LcV12.99%-个人-36m",
+        type: "审核中"
+      },
+      {
+        name: "张三",
+        tel: "15793329457",
+        vmodel: "福田奥铃捷运冷藏",
+        invioce: 19000,
+        lamount: 15000,
+        laompany: "sp-等额本息-LcV12.99%-个人-36m",
+        type: "待审核"
+      },
+      {
+        name: "张三",
+        tel: "15793329457",
+        vmodel: "福田奥铃捷运冷藏",
+        invioce: 19000,
+        lamount: 15000,
+        laompany: "sp-等额本息-LcV12.99%-个人-36m",
+        type: "审核通过"
+      }
+    ],
+    btns: [
+      { name: "修改", type: "drafts", success () { } },
+      { name: "查看", type: "provided", success () { } },
+      { name: "修改", type: "provided", success () { } },
+      { name: "上传资料", type: "provided", success () { } }
+    ]
+  },
+  onLoad: function (options) {
+    let titleArr = [{ name: "草稿箱", value: "drafts" }, { name: "已填报", value: "provided" }];
+    let filter_title = titleArr.filter(item => item.value == options.data);
+    this.setData({
+      title: filter_title.length != 0 ? filter_title[0]['name'] : '草稿箱',
+      type: options.data || 'drafts'
+    })
+  },
+  onReady: function () {
+
+  },
+  onShow: function () {
+
+  },
+  onHide: function () {
+
+  },
+  onUnload: function () {
+
+  },
+  onPullDownRefresh: function () {
+
+  },
+  onReachBottom: function () {
+
+  }
+})

+ 3 - 0
pages/template/index.json

@@ -0,0 +1,3 @@
+{
+  "usingComponents": {}
+}

+ 37 - 0
pages/template/index.wxml

@@ -0,0 +1,37 @@
+<cu-custom bgColor="bg-gradual-blue" isBack>
+  <view slot="backText">返回</view>
+  <view slot="content">{{title}}</view>
+</cu-custom>
+<view class="section">
+  <view wx:for="{{value}}" wx:key="index" class="item margin-bottom-sm bg-white padding">
+    <view class="type padding-bottom text-xl text-black">{{item.type}}</view>
+    <view class="text-cut lheight text-lg">
+      <text class="title">姓名</text>
+      <text class=" text-grey">{{item.name}}</text>
+    </view>
+    <view class="text-cut lheight text-lg">
+      <text class="title">手机号</text>
+      <text class=" text-grey">{{item.tel}}</text>
+    </view>
+    <view class="text-cut lheight text-lg">
+      <text class="title">贷款产品</text>
+      <text class=" text-grey">{{item.laompany}}</text>
+    </view>
+    <view class="text-cut lheight text-lg">
+      <text class="title">车型</text>
+      <text class=" text-grey">{{item.vmodel}}</text>
+    </view>
+    <view class="text-cut lheight text-lg">
+      <text class="title">车辆发票金额</text>
+      <text class="text-grey text-price">{{item.invioce}}</text>
+    </view>
+    <view class="text-cut lheight text-lg">
+      <text class="title">申请贷款金额</text>
+      <text class="text-price  text-grey">{{item.lamount}}</text>
+    </view>
+    <view class="btns">
+      <button wx:for="{{btns}}" wx:if="{{item.type==type}}"
+        class="cu-btn round bg-blue button-hover margin-left margin-top" wx:key="index">{{item.name}}</button>
+    </view>
+  </view>
+</view>

+ 25 - 0
pages/template/index.wxss

@@ -0,0 +1,25 @@
+/* 开发者 */
+.section .item{
+  overflow: hidden;
+  width: 100%;
+  box-sizing: border-box;
+}
+.section .title::after{
+  content:":";
+  display: inline-block;
+  padding: 0 4rpx;
+}
+
+.section .item>view{
+  white-space: nowrap;
+}
+
+.section .item .btns{
+  display: flex;
+  justify-content: flex-end;
+  flex-wrap: wrap;
+}
+
+.section .item .lheight{
+  line-height: 42rpx;
+}

+ 55 - 0
pages/try/index.js

@@ -0,0 +1,55 @@
+Page({
+  data: {
+    camera: "../../assets/try/camera.png"
+  },
+  // 拍照
+  takePhoto () {
+    const ctx = wx.createCameraContext();
+    ctx.takePhoto({
+      quality: 'high',
+      success: res => {
+        // 旋转图片
+        var canvas = wx.createContext();
+        canvas.rotate(90 * Math.PI / 180);
+        canvas.drawImage(res.tempImagePath);
+        wx.drawCanvas({
+          canvasId: "canvas",
+          success: res => this.see(res.tempImagePath)
+        })
+        // this.see(res.tempImagePath)
+      }
+    })
+  },
+  error (e) {
+    console.log(e.detail)
+  },
+
+  // 预览
+  see (data) {
+    wx.previewImage({
+      current: data, // 当前显示图片的http链接
+      urls: [data] // 需要预览的图片http链接列表
+    })
+  },
+
+  onLoad: function (options) {
+
+  },
+  onReady: function () {
+
+  },
+  onShow: function () {
+  },
+  onHide: function () {
+
+  },
+  onUnload: function () {
+
+  },
+  onPullDownRefresh: function () {
+
+  },
+  onReachBottom: function () {
+
+  },
+})

+ 3 - 0
pages/try/index.json

@@ -0,0 +1,3 @@
+{
+  "usingComponents": {}
+}

+ 6 - 0
pages/try/index.wxml

@@ -0,0 +1,6 @@
+<view class="try">
+  <camera device-position="back" flash="off" binderror="error" class="camera">
+  </camera>
+</view>
+<view bindtap="takePhoto" class="image"></view>
+<canvas id="canvas"></canvas>

+ 30 - 0
pages/try/index.wxss

@@ -0,0 +1,30 @@
+.try{
+  width: 100vw;height: 100vh;
+  display: flex;align-items: center;justify-content: center;
+  background: #000;
+  position: relative;
+}
+
+.camera{
+  border: 1px solid var(--yellow);
+  width: 95vw;height: calc(95vw * 1.5);
+  box-sizing: border-box;
+  border-radius: 5px;
+}
+ .image{
+   position: absolute;
+   bottom: 20rpx;left:calc(50vw - 50rpx);
+  width: 100rpx;height: 100rpx;
+  background-size: 100rpx 100rpx;
+  box-sizing: border-box;
+  border: 10rpx solid #fff;
+  border-radius: 50%;
+  display: flex;align-items: center;justify-content: center;
+}
+ .image::after{
+  width: 60%; height: 60%;
+  background-color: #f03;
+  border-radius: 50%;
+  content: '';
+  display: block;
+}

+ 2 - 2
project.config.json

@@ -36,7 +36,7 @@
       "outputPath": ""
     },
     "enableEngineNative": false,
-    "useIsolateContext": false,
+    "useIsolateContext": true,
     "userConfirmedBundleSwitch": false,
     "packNpmManually": false,
     "packNpmRelationList": [],
@@ -48,7 +48,7 @@
   },
   "compileType": "miniprogram",
   "libVersion": "2.19.4",
-  "appid": "wx8677e8f4aefd7e12",
+  "appid": "wx96d0273e2070b2c8",
   "projectname": "%E9%87%91%E8%9E%8D%E5%B0%8F%E7%A8%8B%E5%BA%8F",
   "debugOptions": {
     "hidedInDevtools": []

+ 18 - 0
project.private.config.json

@@ -23,6 +23,24 @@
           "pathName": "pages/add/index",
           "query": "",
           "scene": null
+        },
+        {
+          "name": "模板",
+          "pathName": "pages/template/index",
+          "query": "",
+          "scene": null
+        },
+        {
+          "name": "附件",
+          "pathName": "pages/accessory/index",
+          "query": "",
+          "scene": null
+        },
+        {
+          "name": "尝试",
+          "pathName": "pages/try/index",
+          "query": "",
+          "scene": null
         }
       ]
     }