dachejiesuan.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  1. <template>
  2. <view class="contentColumnC">
  3. <view class="contentColumnC" style="width:700rpx;background-color: white;">
  4. <view class="contentInRowL sizeSpace">
  5. <text class="ztextfontB2">费用明细</text>
  6. </view>
  7. <view class="contentInRowS sizeSpace">
  8. <view class="contentInRowL" style="align-items:center;">
  9. <text class="textfontB3">总费用:</text>
  10. <text style="font-size: 50rpx;font-weight: bold;">{{XChengObj.amount}}</text>
  11. <text class="textfontB3">元</text>
  12. </view>
  13. <!-- <view class="contentInRowR">
  14. <text class="textfontB3">支付宝支付</text>
  15. <uni-icons></uni-icons>
  16. </view> -->
  17. </view>
  18. <!-- <view class="contentInRowL sizeSpace">
  19. <text class="textfontB3" style="color:darkgray;width: 660rpx;">预估价不含附加费,本次行程产生高速费12元,与预估相比正常,且无其他附加费用</text>
  20. </view> -->
  21. <view class="contentInRowS sizeSpace">
  22. <text class="textfontB3">起步费</text>
  23. <text class="textfontB3">{{qibuf}}元</text>
  24. </view>
  25. <view class="contentInRowS sizeSpace">
  26. <text class="textfontB3">里程费</text>
  27. <text class="textfontB3">{{XChengObj.fare}}元</text>
  28. </view>
  29. <view class="contentInRowS sizeSpace">
  30. <text class="textfontB3">其他费用</text>
  31. <text class="textfontB3">{{getqitafy()}}元</text>
  32. </view>
  33. <!-- <view class="contentInRowS sizeSpace">
  34. <text class="textfontB3">优惠券</text>
  35. <text class="textfontB3">0元</text>
  36. </view> -->
  37. <view class="contentColumnC bottomViewBt">
  38. <text class="quxiaoBt" @click="quzhifu">去支付</text>
  39. </view>
  40. </view>
  41. </view>
  42. </template>
  43. <script>
  44. import api from "@/pages/api/api.js"
  45. export default {
  46. name:"dachejiesuan",
  47. props: {
  48. XChengObj:'',
  49. qibuf:0
  50. },
  51. data() {
  52. return {
  53. };
  54. },
  55. methods:{
  56. getqitafy(){
  57. var qt = this.XChengObj.amount*1-this.XChengObj.fare*1-this.qibuf*1;
  58. if(qt<=0){
  59. qt=0;
  60. }
  61. return qt.toFixed(2);
  62. },
  63. quzhifu(){
  64. uni.showToast({
  65. title:'模拟支付完成',//that.i18n('api.wangluoshibai'),
  66. icon: 'none',
  67. duration: 2500
  68. })
  69. var data = {
  70. id:this.XChengObj.id,
  71. state:4
  72. }
  73. this.SetTxorder(data,0);
  74. },
  75. SetTxorder(data,index){
  76. api('SetTxorder',data,res=>{
  77. console.log('SetTxorder------',res)
  78. if(res.data.code==200){
  79. this.pushMsg(this.XChengObj.driver.cid,this.XChengObj.user.phone,'乘客支付了');
  80. uni.showToast({
  81. title:'修改成功',//that.i18n('api.wangluoshibai'),
  82. icon: 'none',
  83. duration: 2500
  84. })
  85. this.$emit('EZfSelect',1);
  86. }
  87. else{
  88. uni.showToast({
  89. title:'修改失败',//that.i18n('api.wangluoshibai'),
  90. icon: 'none',
  91. duration: 2500
  92. })
  93. }
  94. },failc=>{
  95. //console.log('getTaxiPrices----',failc)
  96. uni.showToast({
  97. title:'网络错误',//that.i18n('api.wangluoshibai'),
  98. icon: 'none',
  99. duration: 2500
  100. })
  101. })
  102. },
  103. pushMsg(cid,phone,msg){//消息推送
  104. var time=new Date();
  105. var n,y,r,h,m,s;
  106. n=time.getFullYear();
  107. y=time.getMonth()+1;
  108. r=time.getDate();
  109. h=time.getHours();
  110. m=time.getMinutes();
  111. s=time.getSeconds();
  112. var timsStr = n+'-'+y+'-'+r+' '+h+':'+m+':'+s;
  113. var payloadData={
  114. rcuser:'尾号:'+phone.slice(-4),
  115. time:timsStr,
  116. msg:msg,
  117. type:1
  118. }
  119. api('pushMsgQS',{
  120. cid:cid,
  121. title:'您有新消息了',
  122. content:msg,
  123. payload:payloadData
  124. },res=>{
  125. },failc=>{
  126. //console.log('getadvertis----',failc)
  127. })
  128. },
  129. getVNPay(){
  130. var language = uni.getStorageSync('language');
  131. var lg;
  132. if(language=='yuenan'){
  133. lg='vi';
  134. }
  135. else{
  136. lg='en';
  137. }
  138. api('VNPay',{
  139. orderid:this.XChengObj.ddId,
  140. amount:this.XChengObj.amount,
  141. language:lg
  142. },res=>{
  143. if(res.data.code!=200){
  144. uni.showToast({
  145. title: res.data.msg,
  146. icon: 'none',
  147. duration: 3500
  148. })
  149. return;
  150. }
  151. uni.navigateTo({
  152. url:'/pages/OrderList/buy/Zhifuyemian?url='+ encodeURIComponent(JSON.stringify(res.data.data))+'&ddid='+this.XChengObj.ddId
  153. })
  154. },failc=>{
  155. //console.log('getadvertis----',failc)
  156. })
  157. },
  158. },
  159. }
  160. </script>
  161. <style>
  162. .sizeSpace{
  163. width:660rpx;
  164. margin-top: 20rpx;
  165. align-items: center;
  166. }
  167. .bottomViewBt{
  168. margin-top: 40rpx;
  169. width:580rpx;
  170. }
  171. .quxiaoBt{
  172. margin-top: 30rpx;
  173. margin-bottom: 30rpx;
  174. padding-left: 50rpx;
  175. padding-right: 50rpx;
  176. font-size: 32rpx;
  177. font-weight: bold;
  178. line-height: 60rpx;
  179. border-radius: 30rpx;
  180. text-align: center;
  181. background-color: #E86E48;
  182. color: white;
  183. }
  184. .querenBt{
  185. margin-top: 30rpx;
  186. margin-bottom: 30rpx;
  187. padding-left: 50rpx;
  188. padding-right: 50rpx;
  189. font-size: 32rpx;
  190. font-weight: bold;
  191. border: 1rpx solid darkgray;
  192. line-height: 60rpx;
  193. border-radius: 30rpx;
  194. text-align: center;
  195. background-color: white;
  196. color: #1A1A1A;
  197. }
  198. </style>