tran.vue 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255
  1. <template>
  2. <view class="page">
  3. <uni-nav-bar rightWidth='136rpx' title="传送" fixed :border="false" statusBar backgroundColor="#24234B" color="#FFFFFF">
  4. <template #left>
  5. <view class="cl-topbar__icon" @click="navigateBack">
  6. <text class="cl-icon-arrow-left"></text>
  7. </view>
  8. </template>
  9. <template #right>
  10. <view style="
  11. width: 136rpx;
  12. height: 52rpx;
  13. background: linear-gradient( 130deg, #322D52 20%, #6E47A2 100%);
  14. border-radius: 12rpx;
  15. text-align: center;
  16. line-height:52rpx;
  17. color: #FFFFFF;
  18. font-weight: bold;
  19. font-size: 24rpx;
  20. " @click="navToTran">
  21. 记录
  22. </view>
  23. </template>
  24. </uni-nav-bar>
  25. <view class="bodyMain">
  26. <view class="bg">
  27. <view style="margin-top: 140rpx;" class="item">
  28. <image class="iconId" mode="widthFix" src="http://c.yujianmate.com/images/v1/w3/tran/tran_num.png"></image>
  29. <text style="margin-left: 10rpx;font-weight: bold;font-size: 32rpx; color: #ffffff;">传送数量</text>
  30. </view>
  31. <view class="num1">
  32. <view class="num">
  33. <input type="number" v-model="num" placeholder="请输入传送数量" maxlength="16" />
  34. </view>
  35. <view class="all" @click="num = myinfo.num_gmb">
  36. 全部
  37. </view>
  38. </view>
  39. <view class="line"></view>
  40. <view class="num2">
  41. <view class="num">
  42. 可传送数量
  43. </view>
  44. <view class="all">
  45. {{myinfo.num_gmb}}
  46. </view>
  47. </view>
  48. <view class="item">
  49. <image class="iconId" mode="widthFix" src="http://c.yujianmate.com/images/v1/w3/tran/tran_id.png"></image>
  50. <text style="margin-left: 10rpx;font-weight: bold;font-size: 32rpx; color: #ffffff;">传送ID</text>
  51. </view>
  52. <view class="num1">
  53. <view class="num">
  54. <input type="number" v-model="mobile" placeholder="请输入传送手机号" maxlength="11" />
  55. </view>
  56. <view class="all">
  57. </view>
  58. </view>
  59. <view class="line"></view>
  60. <view class="num2">
  61. <view class="num">
  62. 传送消耗
  63. </view>
  64. <view class="all">
  65. {{myinfo.fee}}
  66. </view>
  67. </view>
  68. <view class="item" @click="tranSubmit">
  69. <view class="btn">
  70. <text style="margin-top: 28rpx;font-weight: bold;font-size: 28rpx; color: #ffffff;">确认传送</text>
  71. </view>
  72. </view>
  73. </view>
  74. <view class="bg2">
  75. <view class="item">
  76. <!-- <image class="iconId" mode="widthFix" src="http://c.yujianmate.com/images/v1/w3/tran/tran_rule.png"></image> -->
  77. <text style="font-weight: bold;font-size: 32rpx; color: #ffffff;">传送规则</text>
  78. </view>
  79. <view class="itemRule">
  80. <view style="height: 74rpx;margin-top: 25rpx;" class="ruleItem">
  81. <view style="margin-top: 5rpx;" class="info">
  82. <view class="left">
  83. <text style="font-size: 24rpx; color: #999999;">战队人数</text>
  84. </view>
  85. <view class="right">
  86. <text style="font-size: 24rpx;color: #999999;">传送消耗</text>
  87. </view>
  88. </view>
  89. <view style="margin-top: 25rpx;" class="line"></view>
  90. </view>
  91. <view class="ruleItem" v-for="(info,index) in ruleInfo">
  92. <view class="info">
  93. <view class="left">
  94. <text style="font-size: 22rpx;color: white;">{{ info.reason }}</text>
  95. </view>
  96. <view style="color: white;" class="right">
  97. <text style="font-size: 22rpx;color: white;">{{ info.per }}</text>
  98. </view>
  99. </view>
  100. <view class="line"></view>
  101. </view>
  102. <text style="margin-top: 10rpx;font-size:22rpx;color: #999999;">注:按照用户战队人数来判定传送燃料消耗</text>
  103. </view>
  104. </view>
  105. </view>
  106. <ToastW3 ref="ToastW3"></ToastW3>
  107. </view>
  108. </template>
  109. <script>
  110. import uniNavBar from '../../components/uni-ui/uni-nav-bar/uni-nav-bar.vue'
  111. export default {
  112. components: {uniNavBar},
  113. data() {
  114. return {
  115. myinfo: {},
  116. num: '',
  117. mobile: '',
  118. ruleInfo: [{
  119. reason: "0人",
  120. per: "40%",
  121. },
  122. {
  123. reason: "3人",
  124. per: "38%",
  125. },
  126. {
  127. reason: "5人",
  128. per: "35%",
  129. },
  130. {
  131. reason: "10人",
  132. per: "30%",
  133. },
  134. {
  135. reason: "15人",
  136. per: "25%",
  137. },
  138. {
  139. reason: "银河探索卡",
  140. per: "20%",
  141. },
  142. {
  143. reason: "星界探索卡",
  144. per: "18%",
  145. }
  146. ]
  147. }
  148. },
  149. onLoad() {
  150. let self = this;
  151. this.loadData();
  152. },
  153. onShow() {
  154. // uni.hideTabBar({
  155. // animation:false
  156. // })
  157. // this.loadData(1);
  158. // this.showBottomPlayer();
  159. },
  160. methods: {
  161. navigateBack(){
  162. uni.navigateBack(1)
  163. },
  164. navToTran: function() {
  165. uni.navigateTo({
  166. url: "/pages/w3/tranRecord?stype=tran"
  167. });
  168. },
  169. cancel() {
  170. this.title = '录音取消,停止录音';
  171. console.log('cancel', new Date().getTime());
  172. },
  173. loadData() {
  174. console.log({
  175. uuid: getApp().globalData.uuid,
  176. skey: getApp().globalData.skey
  177. });
  178. uni.request({
  179. url: this.$apiHost + '/Web/getinfo',
  180. data: {
  181. uuid: getApp().globalData.uuid
  182. },
  183. header: {
  184. "content-type": "application/json",
  185. 'sign': getApp().globalData.headerSign
  186. },
  187. success: (res) => {
  188. console.log("----:", res.data);
  189. this.myinfo = res.data;
  190. },
  191. complete: (com) => {
  192. // uni.hideLoading();
  193. },
  194. fail: (e) => {
  195. console.log("----e:", e);
  196. }
  197. });
  198. },
  199. tranSubmit() {
  200. var that = this;
  201. if (this.num < 1) {
  202. that.$refs['ToastW3'].showToast({
  203. title: "请填写数量",
  204. animation: 0
  205. });
  206. return;
  207. }
  208. if (this.mobile.length < 11) {
  209. that.$refs['ToastW3'].showToast({
  210. title: "请填写对方手机号",
  211. animation: 0
  212. });
  213. return;
  214. }
  215. uni.showLoading({})
  216. uni.request({
  217. url: this.$apiHost + '/Trade/tran',
  218. data: {
  219. uuid: getApp().globalData.uuid,
  220. num: this.num,
  221. mobile: this.mobile
  222. },
  223. header: {
  224. "content-type": "application/json",
  225. 'sign': getApp().globalData.headerSign
  226. },
  227. success: (res) => {
  228. console.log("----:", res.data);
  229. that.$refs['ToastW3'].showToast({
  230. title: res.data.str,
  231. animation: 0
  232. });
  233. if (res.data.success == "yes") {
  234. this.num = 0;
  235. this.loadData();
  236. }
  237. },
  238. complete: (com) => {
  239. uni.hideLoading();
  240. },
  241. fail: (e) => {
  242. console.log("----e:", e);
  243. }
  244. });
  245. },
  246. }
  247. }
  248. </script>
  249. <style scoped lang="scss">
  250. @import 'tran.scss';
  251. </style>