123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123 |
- <template>
- <view class="container">
- <form @submit="bindSave">
- <view class="header">
- <view class="title">上传照片</view>
- <view class="sub-title">请上传清䀿照片为获得准确的结果,请您在光线充足的环境下测试,时间最好在上午9:00--11:00</view>
- </view>
- <view class="tui-box-upload">
- <tui-upload :value="value" :limit="1" @complete="result" @remove="remove"></tui-upload>
- </view>
- <view class="tui-btn-box">
- <tui-button formType="submit" type="danger" height="88rpx" shape="circle">提交</tui-button>
- </view>
- </form>
- </view>
- </template>
- <script>
- import pay from '@/common/pay.js'
- export default {
- data() {
- return {
- imageData: [],
- value: []
- }
- },
- onLoad() {
-
- },
- onShow: function() {
- var _this = this;
- _this.$request.post('tongue.check').then(res => {
- if (res.errno == 0) {
- if (res.data.id){
- uni.reLaunch({
- url: "/pagesA/my/tongue/detail?id=" + res.data.id
- });
- }
- }
- });
- },
- methods: {
- result: function(e) {
- console.log(e)
- this.imageData = e.imgArr;
- },
- remove: function(e) {
-
- console.log(e)
- let index = e.index
- },
- bindSave: function(e) {
- var _this = this;
- _this.$request.post('tongue.upload', {
- img: this.imageData[0]
- }).then(res => {
- if (res.errno != 0) {
- uni.showToast({
- title: res.msg,
- icon: 'none'
- });
- return;
- } else {
-
- pay.wxpay('tongue', res.data.price, res.data.id, "/pagesA/my/tongue/detail?id=" + res
- .data.id);
- }
- });
- }
- },
-
- onPullDownRefresh: function() {
- setTimeout(() => {
- uni.stopPullDownRefresh()
- }, 200);
- },
- }
- </script>
- <style>
- page {
- background-color: #fff;
- }
- .container {
- padding: 20rpx 0 120rpx 0;
- box-sizing: border-box;
- }
- .header {
- padding: 80rpx 90rpx 60rpx 90rpx;
- box-sizing: border-box;
- }
- .title {
- font-size: 34rpx;
- color: #333;
- font-weight: 500;
- }
- .sub-title {
- font-size: 24rpx;
- color: #7a7a7a;
- padding-top: 18rpx;
- }
- .tui-box-upload {
- padding-left: 50rpx;
- box-sizing: border-box;
- }
- .tui-btn-box {
- width: 100%;
- padding: 20rpx;
- box-sizing: border-box;
- }
- </style>
|