myorder.vue 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377
  1. <template>
  2. <view class="box">
  3. <view class="tab">
  4. <view class="tabLine" :class="{tabActive:tabIndex==5}" @click="tabClick(5)">全部</view>
  5. <view class="tabLine" :class="{tabActive:tabIndex==1}" @click="tabClick(1)">待付款</view>
  6. <view class="tabLine" :class="{tabActive:tabIndex==2}" @click="tabClick(2)">待确认</view>
  7. <view class="tabLine" :class="{tabActive:tabIndex==4}" @click="tabClick(3)">待收货</view>
  8. <view class="tabLine" :class="{tabActive:tabIndex==2}" @click="tabClick(4)">待服务</view>
  9. <view class="tabLine" :class="{tabActive:tabIndex==4}" @click="tabClick(5)">待评价</view>
  10. </view>
  11. <view class="main">
  12. <view class="itemLine" v-for="(item,index) in items" @click="goDetail(item.ID)">
  13. <view class="flex2 itemlineTOp">
  14. <view class="itemCode">{{item.Code}}</view>
  15. <view class="itemSheetState" v-if="item.SheetState==1">待付款</view>
  16. <view class="itemSheetState" v-if="item.SheetState==2">待服务</view>
  17. <view class="itemSheetState" v-if="item.SheetState==3||item.SheetState==5">已完成</view>
  18. <view class="itemSheetState" v-if="item.SheetState==4">已完成</view>
  19. <view class="itemSheetState" v-if="item.SheetState==0">已取消</view>
  20. </view>
  21. <view class="itemLineImgBox">
  22. <view class="itemGoddsImgBox">
  23. <view v-for="(v,i) in item.goods.concat(item.items)" v-if="i<4">
  24. <image :src="v.Url" mode="" class="goodsImg" v-if="i<4&&v"></image>
  25. <image src="../../static/img/noimg.png" mode="" class="goodsImg" v-else></image>
  26. </view>
  27. <view v-if="item.goods.concat(item.items).length==0">
  28. <image src="../../static/img/noimg.png" mode="" class="goodsImg" ></image>
  29. </view>
  30. </view>
  31. <view>
  32. <image src="../../static/img/diandian.png" mode="widthFix" class="diandianImg"></image>
  33. </view>
  34. </view>
  35. <view class="raleMoneyBox">
  36. <span>实付款</span> <span class="raleMoneySpan">¥{{item.raleMoney}}</span>
  37. </view>
  38. <view class="itemLineBottom" v-if="item.SheetState==1||item.SheetState==3||item.SheetState==4">
  39. <view class="itemBtn1" v-if="item.SheetState==1" @click.stop="cancelOrder(item)">取消订单</view>
  40. <view class="itemBtn2" v-if="item.SheetState==1" @click.stop="orderPay(item)">立即支付</view>
  41. <view class="itemBtn2" v-if="item.EvaluateState==0&&item.EState==1" @click.stop="goEvaluate(item)">立即评价</view>
  42. <view class="itemBtn1" v-if="item.EvaluateState==1" @click.stop="gopingjia(item)">查看评价</view>
  43. </view>
  44. <!-- 待服务的-->
  45. <view class="daifuwuBOxDiv" v-if="item.SheetState==2">
  46. <view class="daifuwuBOx">
  47. <view class="daifuwuBOxTop">
  48. <image src="../../static/img/orderyytime.png" mode="" class="orderyytimeImg"></image>
  49. <view class="daifuwuBOxTitle">预约信息</view>
  50. </view>
  51. <view class="daifuwuBOxLIne">门店名称:{{item.ShopName}}</view>
  52. <view class="daifuwuBOxLIne">预约到店信息:{{item.OrderTime}}</view>
  53. </view>
  54. </view>
  55. </view>
  56. <nodata v-show="items==''&&isload"></nodata>
  57. </view>
  58. </view>
  59. </template>
  60. <script>
  61. import nodata from '@/components/nodata/nodata.vue'
  62. export default {
  63. components: {
  64. nodata
  65. },
  66. data() {
  67. return {
  68. page:1,
  69. state:'',
  70. num:'',
  71. tabIndex:'',
  72. items:[],
  73. isload:false,
  74. }
  75. },
  76. onLoad(opt) {
  77. var num=opt.num;
  78. this.tabIndex=num;
  79. this.items=[]
  80. if(num==5){
  81. this.state=''
  82. }else{
  83. this.state=num
  84. }
  85. this.getData()
  86. },
  87. onShow() {
  88. console.log(this.tabIndex)
  89. var evaluate = uni.getStorageSync("evaluate")
  90. if(evaluate){
  91. this.items=[]
  92. this.getData()
  93. uni.removeStorageSync('evaluate');
  94. }
  95. },
  96. methods: {
  97. goEvaluate(item){
  98. uni.navigateTo({
  99. url:'evaluate?shopID=' + item.ShopID + '&sheetID=' + item.ID
  100. })
  101. },
  102. gopingjia(item){
  103. uni.navigateTo({
  104. url:'../me/myAppraiseDetail?id='+item.ID
  105. })
  106. },
  107. cancelOrder(item){
  108. var that=this;
  109. uni.showModal({
  110. title: '提示',
  111. content: '确定要取消订单吗',
  112. success: function (res) {
  113. if (res.confirm) {
  114. uni.showLoading({ });
  115. that.$http('miniAppMyBMemberCar/updateBMSheetState', {
  116. id:item.ID
  117. },'POST').then(res => {
  118. uni.hideLoading();
  119. that.page=1;
  120. that.items=[]
  121. that.getData()
  122. })
  123. } else if (res.cancel) {
  124. }
  125. }
  126. });
  127. },
  128. tabClick(num){
  129. this.tabIndex=num;
  130. if(num==5){
  131. this.state=''
  132. }else{
  133. this.state=num
  134. }
  135. this.items=[];
  136. this.page=1;
  137. this.getData()
  138. },
  139. goDetail(id){
  140. uni.navigateTo({
  141. url:'orderDetail?id='+id
  142. })
  143. },
  144. getData(){
  145. uni.showLoading({ });
  146. this.isload=false;
  147. if(this.state==4){
  148. var padata={
  149. page:this.page,
  150. limit:10,
  151. evaluateState:1
  152. }
  153. }else{
  154. var padata={
  155. page:this.page,
  156. limit:10,
  157. state:this.state
  158. }
  159. }
  160. this.$http('miniAppMyBMemberCar/listMiniAppBMSheetPage', padata,'GET').then(res => {
  161. uni.hideLoading();
  162. this.isload=true;
  163. //this.list=res.data;
  164. var a=res.data.Items;
  165. this.items=this.items.concat(a)
  166. })
  167. },
  168. orderPay(item){
  169. uni.showLoading({ });
  170. this.$http('miniApp/maintainOrder/orderPay', {
  171. sheetID:item.ID
  172. },'POST').then(res => {
  173. uni.hideLoading();
  174. var payInfo=JSON.parse(res.data.payInfo)
  175. uni.requestPayment({
  176. provider: 'wxpay',
  177. // timeStamp: String(Date.now()),
  178. timeStamp:payInfo.timeStamp,
  179. nonceStr: payInfo.nonceStr,
  180. package: payInfo.package,
  181. signType: payInfo.signType,
  182. paySign: payInfo.paySign,
  183. success: function (res) {
  184. console.log('success:' + JSON.stringify(res));
  185. uni.showToast({
  186. title: '支付成功',
  187. icon:'none',
  188. duration: 2000
  189. });
  190. uni.switchTab({
  191. url:'../index/index'
  192. })
  193. },
  194. fail: function (err) {
  195. console.log('fail:' + JSON.stringify(err));
  196. }
  197. });
  198. })
  199. },
  200. },
  201. onReachBottom(){
  202. this.page++;
  203. /* if(this.tabindex==2){
  204. this.getbMemberShopList()
  205. }else if(this.tabindex==3){
  206. this.getShopFootprint()
  207. } */
  208. this.getData()
  209. },
  210. onPullDownRefresh() {
  211. this.page=1;
  212. this.items=[];
  213. this.getData()
  214. setTimeout(function () {
  215. uni.stopPullDownRefresh();
  216. }, 1000);
  217. }
  218. }
  219. </script>
  220. <style scoped>
  221. .box{
  222. min-height: 100vh;
  223. background: #F4F5F7;
  224. }
  225. .tab{
  226. background: #FFFFFF;
  227. display: flex;
  228. justify-content: space-between;
  229. padding: 0 15rpx;
  230. line-height: 84rpx;
  231. position: fixed;
  232. left: 0;
  233. top: 44px;
  234. width: 720rpx;
  235. z-index: 11;
  236. }
  237. .main{
  238. padding-top:88rpx;
  239. padding-left: 24rpx;
  240. padding-right: 24rpx;
  241. }
  242. /* #ifdef MP-WEIXIN */
  243. .tab{
  244. position: fixed;
  245. left: 0;
  246. top: 0;
  247. }
  248. .main{
  249. padding-top: 88rpx ;
  250. }
  251. /* #endif */
  252. .tabLine{
  253. width: 180rpx;
  254. text-align: center;
  255. }
  256. .tabActive{
  257. color: #FF4F00;
  258. border-bottom: 4rpx solid #FF4F00;
  259. }
  260. .flex2{
  261. display: flex;
  262. justify-content: space-between;
  263. }
  264. .itemLine{
  265. background: #FFFFFF;
  266. margin-top: 20rpx;
  267. }
  268. .itemCode{
  269. font-size: 28rpx;
  270. color: #999999;
  271. }
  272. .itemlineTOp{
  273. padding: 25rpx 20rpx;
  274. }
  275. .itemSheetState{
  276. font-size: 30rpx;
  277. color: #FF4F00
  278. }
  279. .goodsImg{
  280. width: 126rpx;
  281. height: 126rpx;
  282. margin-left: 18rpx;
  283. border-radius: 5rpx;
  284. }
  285. .itemLineImgBox{
  286. display: flex;
  287. }
  288. .itemGoddsImgBox{
  289. display: flex;
  290. width:558rpx;
  291. }
  292. .diandianImg{
  293. width: 50rpx;
  294. margin-left: 50rpx;
  295. margin-top: 50rpx;
  296. }
  297. .raleMoneyBox{
  298. text-align: right;
  299. color: #666666;
  300. font-size: 24rpx;
  301. line-height: 50rpx;
  302. padding-bottom: 20rpx;
  303. /* border-bottom: 1px solid #EEEEEE; */
  304. }
  305. .raleMoneySpan{
  306. color: #3C3C3C;
  307. font-size: 32rpx;
  308. padding-right: 24rpx;
  309. padding-left: 10rpx;
  310. }
  311. .itemLineBottom{
  312. display: flex;
  313. justify-content: flex-end;
  314. padding-top: 20rpx;padding-bottom: 20rpx;padding-right: 20rpx;
  315. border-top: 1px solid #EEEEEE; ;
  316. }
  317. .daifuwuBOxDiv{
  318. padding: 20rpx;
  319. }
  320. .itemBtn1{
  321. width: 150rpx;
  322. height: 56rpx;
  323. border-radius: 36rpx;
  324. border: 2rpx solid #DDDDDD;
  325. text-align: center;
  326. line-height: 56rpx;
  327. font-size: 28rpx;
  328. color: #3C3C3C;
  329. margin-left: 40rpx;
  330. }
  331. .itemBtn2{
  332. width: 150rpx;
  333. height: 56rpx;
  334. border-radius: 36rpx;
  335. border: 2rpx solid #FF4F00;
  336. text-align: center;
  337. line-height: 56rpx;
  338. font-size: 28rpx;
  339. color: #FF4F00;
  340. margin-left: 40rpx;
  341. }
  342. .daifuwuBOx{
  343. width: 662rpx;
  344. height: 175rpx;
  345. background: rgba(255, 79, 0, 0.04);
  346. border-radius: 6rpx;
  347. }
  348. .orderyytimeImg{
  349. width: 32rpx;
  350. height: 32rpx;
  351. }
  352. .daifuwuBOxTop{
  353. display: flex;
  354. padding: 20rpx 0 20rpx 20rpx;
  355. color: #FF4F00;
  356. font-size: 28rpx;
  357. }
  358. .daifuwuBOxTitle{
  359. line-height: 32rpx;padding-left: 10rpx;
  360. }
  361. .daifuwuBOxLIne{
  362. color: #666666;
  363. font-size: 26rpx;
  364. line-height: 40rpx;
  365. padding-left: 20rpx;
  366. }
  367. </style>