pay.vue 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  1. <template>
  2. <view>
  3. <!-- 弹窗 -->
  4. <view class="bgbox" @click="getClose" v-if="type"></view>
  5. <view v-if="type=='buy'" class="buybox">
  6. <view class="buytops">
  7. <view class="detop flexc mb18">
  8. <image :src="zfbimg" class="buyimg"></image>
  9. <view class="tit"><text class="f13">¥</text> 249</view>
  10. <view class="tbtn">原价¥299</view>
  11. </view>
  12. <view class="paybox mb12">
  13. <view class="buylist flexc" @click="getAddressFn">
  14. <view class="tit over flex1">安徽省合肥市蜀山区幸福大街88号幸福小区…</view>
  15. <view class="txt">添加</view>
  16. <image :src="rimg" class="rimg"></image>
  17. </view>
  18. </view>
  19. <view class="paybox mb12">
  20. <view class="buylist flexc">
  21. <view class="tit flex1">数量88号幸福小区…</view>
  22. <view class="flexc inputs">
  23. <view @click="_calcValue('minus')">-</view>
  24. <input type="number" contenteditable="true" v-model="inputValue" class="numinp" />
  25. <view @click="_calcValue('plus')">+</view>
  26. </view>
  27. </view>
  28. <picker range-key='text' :value="syqxidx" :range="sexs" @change='bindDateChange'>
  29. <view class="buylist flexc">
  30. <view class="tit">优惠券</view>
  31. <view class="flex1 txr f12" :class="iszc?'co025':'coa'">{{iszc?'家政服务满200减50':'选择上门时间'}}</view>
  32. <image :src="rimg" class="rimg"></image>
  33. </view>
  34. </picker>
  35. <picker range-key='text' :value="syqxidx" :range="sexs" @change='bindDateChange'>
  36. <view class="buylist flexc">
  37. <view class="tit">预约时间</view>
  38. <view class="flex1 txr f12" :class="iszc?'co27':'coa'">{{iszc?'是':'选择上门时间'}}</view>
  39. <image :src="rimg" class="rimg"></image>
  40. </view>
  41. </picker>
  42. <view class="buylist flexc">
  43. <view class="tit mr18">订单备注</view>
  44. <uni-easyinput type="textarea" autoHeight v-model="iszc" :inputBorder='false' placeholder="添加留言,让我们的服务更贴心~" />
  45. <view class="voice flexc">
  46. <image :src="voiceimg"></image>
  47. 语音输入
  48. </view>
  49. </view>
  50. </view>
  51. <view class="paybox">
  52. <view class="tit tits">支付方式</view>
  53. <view class="buylist flexc mb14">
  54. <image :src="zfbimg" class="zfbimg"></image>
  55. <view class="tit flex1">支付宝支付</view>
  56. <image :src="chose" class="choseimg" v-if="paystu=='zfb'"></image>
  57. <image :src="nchose" class="choseimg" v-else></image>
  58. </view>
  59. <view class="buylist flexc mb8">
  60. <image :src="wximg" class="zfbimg"></image>
  61. <view class="tit flex1">微信支付</view>
  62. <image :src="chose" class="choseimg" v-if="paystu=='wx'"></image>
  63. <image :src="nchose" class="choseimg" v-else></image>
  64. </view>
  65. </view>
  66. </view>
  67. <view class="buybtn">立即支付 ¥249</view>
  68. </view>
  69. </view>
  70. </template>
  71. <script>
  72. import config from '@/config'
  73. const baseUrl = config.baseUrl
  74. import { getToken } from '@/utils/auth'
  75. import {uploadmore} from '@/utils/common.js'
  76. export default{
  77. components:{},
  78. props:{
  79. type: {
  80. type: String,
  81. default () {
  82. return ''
  83. }
  84. },
  85. },
  86. data(){
  87. return{
  88. baseUrl:config.baseUrl,
  89. chose:require("@/work/static/chose.png"),
  90. nchose:require("@/work/static/nchose.png"),
  91. zfbimg:require("@/work/static/zfb.png"),
  92. wximg:require("@/work/static/wx.png"),
  93. rimg:require("@/static/images/rimg.png"),
  94. voiceimg:require("@/work/static/voice.png"),
  95. step:1,
  96. min:1,
  97. paystu:'zfb',
  98. syqxidx:'',
  99. iszc:'2323',
  100. sexs: [{
  101. text: '男',
  102. value: 0
  103. }, {
  104. text: '女',
  105. value: 1
  106. }],
  107. }
  108. },
  109. mounted() {
  110. this.baseUrl=baseUrl
  111. },
  112. watch:{
  113. type(val){
  114. // this.filelist=[];
  115. // this.shtext='';
  116. // this.isty='2';
  117. // this.phofile=[];
  118. }
  119. },
  120. methods:{
  121. bindDateChange(e){
  122. },
  123. getAddressFn(){
  124. this.$emit('getAddressFn')
  125. },
  126. _calcValue(type) {
  127. // if (this.disabled) {
  128. // return;
  129. // }
  130. const scale = this._getDecimalScale();
  131. let value = this.inputValue * scale;
  132. let step = this.step * scale;
  133. if (type === "minus") {
  134. value -= step;
  135. if (value < (this.min * scale)) {
  136. return;
  137. }
  138. if (value > (this.max * scale)) {
  139. value = this.max * scale
  140. }
  141. }
  142. if (type === "plus") {
  143. value += step;
  144. if (value > (this.max * scale)) {
  145. return;
  146. }
  147. if (value < (this.min * scale)) {
  148. value = this.min * scale
  149. }
  150. }
  151. this.inputValue = (value / scale).toFixed(String(scale).length - 1);
  152. },
  153. _getDecimalScale() {
  154. let scale = 1;
  155. // 浮点型
  156. if (~~this.step !== this.step) {
  157. scale = Math.pow(10, String(this.step).split(".")[1].length);
  158. }
  159. return scale;
  160. },
  161. getClose(){
  162. this.$emit('getClose')
  163. },
  164. }
  165. }
  166. </script>
  167. <style lang="scss" scoped>
  168. .buybox /deep/ .uni-easyinput{min-height: 36rpx;}
  169. .buybox /deep/ .uni-easyinput__content-textarea{min-height:36rpx;font-size: 24rpx;margin: 0;}
  170. .buybox /deep/ .uni-easyinput__placeholder-class{font-size: 24rpx;color: #AAAAAA;}
  171. .buybox{position: fixed;left: 0;right: 0;bottom: 0;z-index: 10;min-height: calc(100vh - 476rpx);background: #F3F3F0;border-radius: 20rpx 20rpx 0 0;box-sizing: border-box;max-height: calc(100vh - 200rpx);overflow: hidden;display: flex;flex-direction: column;
  172. .buytops{padding: 36rpx 18rpx 60rpx;flex: 1;overflow: auto;
  173. .detop{padding:0 12rpx;
  174. .buyimg{width: 90rpx;height: 90rpx;margin-right: 34rpx;flex: 0 0 auto;}
  175. .tit{font-weight: bold;font-size: 40rpx;color: #0256FD;margin-right: 30rpx;word-break: break-all;}
  176. .tbtn{background: #FF9E00;font-weight: 500;font-size:24rpx;padding: 6rpx 12rpx;flex: 0 0 auto;color: #FFFFFF;border-radius: 10rpx;min-height: 46rpx;box-sizing: border-box;}
  177. }
  178. .paybox{background: #FFFFFF;border-radius: 10rpx;padding: 8rpx 0;}
  179. .tit{font-weight: bold;font-size: 26rpx;color: #272727;}
  180. .tits{padding: 28rpx 36rpx 10rpx;}
  181. .buylist{padding: 16rpx 36rpx;min-height: 80rpx;
  182. .txt{font-weight: 500;font-size: 24rpx;color: #AAAAAA;flex: 0 0 auto;margin-left:16rpx;}
  183. .rimg{width: 16rpx;height: 24rpx;flex: 0 0 auto;margin-left:16rpx;}
  184. }
  185. .inputs{border-radius: 10rpx;border: 2rpx solid #DADADA;flex: 0 1 auto;
  186. view{font-size: 26rpx;font-weight: bold;color: #272727;width: 46rpx;flex: 0 0 auto;flex: 0 0 auto;display: flex;align-items: center;justify-content: center;}
  187. input{font-size: 26rpx;font-weight: bold;color: #272727;width: 78rpx;flex: 0 1 auto;border: 2rpx solid #DADADA;border-top: none;border-bottom: none;height: 54rpx;box-sizing: border-box;padding: 0 4rpx;box-sizing: border-box;text-align: center;}
  188. }
  189. .zfbimg{width: 58rpx;height: 58rpx;margin-right: 20rpx;flex: 0 0 auto;}
  190. .choseimg{width: 30rpx;height: 30rpx;margin-left: 30rpx;flex: 0 0 auto;}
  191. }
  192. .voice{font-weight: 500;font-size: 24rpx;color: #45CB99;border-left: 2rpx solid #DADADA;padding-left: 12rpx;margin-left: 12rpx;flex: 0 0 auto;
  193. image{width: 24rpx;height: 24rpx;margin-right: 8rpx;}
  194. }
  195. .buybtn{height: 100rpx;display: flex;align-items: center;justify-content: center;font-weight: bold;font-size: 30rpx;color: #FFFFFF;background: #0156FE;}
  196. }
  197. </style>