index.vue 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317
  1. <template>
  2. <view class="order-content-wrap">
  3. <!-- &lt;!&ndash; 当前订单&ndash;&gt;-->
  4. <!-- <view class="service-order">-->
  5. <!-- <view @click="noUseCoupon()" class="h-no-use-coupons">-->
  6. <!-- <u-icon name="share-square" color="#333" size="25"></u-icon>-->
  7. <!-- <view class="">-->
  8. <!-- <text>不使用优惠券</text>-->
  9. <!-- </view>-->
  10. <!-- </view>-->
  11. <!-- <view v-for="(item,index) in countsList" :class="computedStyle(item)" class="store-wrap bg-img">-->
  12. <!-- <view class="row-list" >-->
  13. <!-- <view @click="useCoupon(item)" class="store-content">-->
  14. <!-- <view class="h-left-content">-->
  15. <!-- <view class="h-text">-->
  16. <!-- <view class="money">¥{{item.discountsPrice}}</view>-->
  17. <!-- <view class="desc">{{item.name}}</view>-->
  18. <!-- </view>-->
  19. <!-- </view>-->
  20. <!-- <view class="h-center-content">-->
  21. <!-- <view class="title">-->
  22. <!-- <text class="h-value">门店通用</text>-->
  23. <!-- </view>-->
  24. <!-- <view class="title">-->
  25. <!-- 使用平台:全平台-->
  26. <!-- </view>-->
  27. <!-- <view class="title">-->
  28. <!-- 有效时间:{{this.dateFormat(item.startTime)}}~{{this.dateFormat(item.endTime)}}-->
  29. <!-- </view>-->
  30. <!-- </view>-->
  31. <!-- <view class="h-right-content">-->
  32. <!-- <u-icon v-if="item.id == couponIds" name="checkmark-circle" color="#333" size="25"></u-icon>-->
  33. <!-- <view v-else class="no-checked"></view>-->
  34. <!-- <view class="h-btn">-->
  35. <!-- &lt;!&ndash; <view @click="useCoupon(item)" class="h-btn-value-receive">选择使用</view> &ndash;&gt;-->
  36. <!-- </view>-->
  37. <!-- </view>-->
  38. <!-- </view>-->
  39. <!-- </view>-->
  40. <!-- </view>-->
  41. <!-- <view v-if="countsList.length == 0" class="footer">-->
  42. <!-- <view class="">-&#45;&#45;暂无数据-&#45;&#45;</view>-->
  43. <!-- </view>-->
  44. <!-- <view v-if="countsList.length > 0" class="footer">-->
  45. <!-- <view class="">-&#45;&#45;到底了-&#45;&#45;</view>-->
  46. <!-- </view>-->
  47. <!-- </view>-->
  48. </view>
  49. </template>
  50. <script>
  51. export default {
  52. data() {
  53. return {
  54. checkboxList1:[
  55. {
  56. name: '苹果',
  57. disabled: false,
  58. },
  59. {
  60. name: '香蕉',
  61. disabled: false,
  62. },
  63. {
  64. name: '橙子',
  65. disabled: false,
  66. },
  67. ],
  68. checkboxValue1: '',
  69. isChecked: false,
  70. couponIds: null ,
  71. currentServiceTab: 'orderTab1', // 当前选中的 Tab
  72. list: [1, 2, 3, 4],
  73. reqParm: {
  74. auth: true,
  75. type: 0
  76. },
  77. countsList: []
  78. };
  79. },
  80. onLoad(option) {
  81. // 选择的优惠券
  82. this.couponIds = option.couponIds;
  83. console.log(option.couponIds)
  84. // 查询可领取的优惠劵
  85. this.getUserDiscountsList();
  86. },
  87. computed: {
  88. },
  89. methods: {
  90. // 日期格式化
  91. dateFormat(date){
  92. let time = Date.parse(date);
  93. return uni.$u.date(time, 'yyyy-mm-dd');
  94. },
  95. // 查询可领取的优惠劵
  96. getUserDiscountsList(){
  97. let that = this;
  98. // 用户绑定门店
  99. getMyCouponList({data:this.reqParm}).then((res)=>{
  100. console.log(res)
  101. this.countsList = res.rows;
  102. }).catch(() =>{
  103. uni.showToast({
  104. title: "操作失败"
  105. })
  106. })
  107. },
  108. computedStyle(item) {
  109. return 'bg-img';
  110. },
  111. // 切换菜单
  112. changeServiceTab(tab){
  113. this.currentServiceTab = tab;
  114. },
  115. // 领取优惠劵
  116. gotoReceiveCoupon(){
  117. uni.showToast({
  118. title: "领取成功"
  119. })
  120. },
  121. // 去使用优惠劵
  122. useCoupon(item){
  123. // 选择完成后返回上一页
  124. uni.navigateBack({
  125. delta: 1,
  126. success: function(res) {
  127. console.log('返回成功');
  128. // 在这里可以处理选择结果
  129. // 可以将选择的内容保存到本地或通过事件传递给上一个页面
  130. uni.$emit('selectedDataCouponChild', item);
  131. }
  132. });
  133. },
  134. // 不使用优惠券
  135. noUseCoupon(){
  136. let data = {
  137. id: null,
  138. discountsPrice: 0
  139. }
  140. // 选择完成后返回上一页
  141. uni.navigateBack({
  142. delta: 1,
  143. success: function(res) {
  144. console.log('返回成功');
  145. // 在这里可以处理选择结果
  146. // 可以将选择的内容保存到本地或通过事件传递给上一个页面
  147. uni.$emit('selectedDataCouponChild', data);
  148. }
  149. });
  150. }
  151. },
  152. };
  153. </script>
  154. <style lang="scss" scoped>
  155. .h-no-use-coupons{
  156. display: flex;
  157. padding-top: 12px;
  158. padding-left: 12px;
  159. padding-right: 12px;
  160. }
  161. /* 服务订单内容*/
  162. .service-order-tab-bar{
  163. background: #fff;
  164. display: flex;
  165. justify-content: space-around;
  166. height: 50px;
  167. background-color: #f5f5f5;
  168. .service-order-tab-item{
  169. flex: 1;
  170. display: flex;
  171. align-items: center;
  172. justify-content: center;
  173. font-size: 16px;
  174. color: #333;
  175. line-height: 26px;
  176. }
  177. .service-order-tab-item.active {
  178. // color: #ff0000;
  179. }
  180. .underline {
  181. border-bottom: 2px solid #FFE05C ;
  182. }
  183. }
  184. .bg-img{
  185. background-image: url('/static/coupon/u210.png');
  186. background-repeat: repeat;
  187. height: 94px;
  188. margin: 12px;
  189. }
  190. .bg-img1{
  191. background-image: url('/static/coupon/u211.png');
  192. background-repeat: repeat;
  193. height: 94px;
  194. margin: 12px;
  195. }
  196. .service-order{
  197. // background: #fff;
  198. }
  199. /* 门店列表 */
  200. .store-wrap{
  201. border-radius: 2px;
  202. padding-bottom: 12px;
  203. padding-left: 12px;
  204. padding-right: 12px;
  205. .row-list{
  206. .store-content{
  207. display: flex;
  208. align-items: center;
  209. height: 94px;
  210. color: #333333;
  211. .h-left-content{
  212. width: 26%;
  213. text-align: center;
  214. .h-text{
  215. width: 100%;
  216. font-weight: 400;
  217. line-height: 18px;
  218. font-size: 12px;
  219. .money{
  220. font-size: 18px;
  221. font-weight: bold;
  222. line-height: 26px;
  223. }
  224. }
  225. }
  226. .h-center-content{
  227. width: 60%;
  228. padding-left: 12px;
  229. .title{
  230. width: 100%;
  231. color: #999999;
  232. font-size: 12px;
  233. .h-value{
  234. font-size: 14px;
  235. line-height: 42px;
  236. color: #333333;
  237. }
  238. }
  239. }
  240. .h-right-content{
  241. width: 14%;
  242. display: flex;
  243. justify-content: flex-end;;
  244. align-items: center;
  245. background-image: url('/static/coupon/u2102.png');
  246. height: 94px;
  247. font-size: 12px;
  248. padding-right: 12px;
  249. .no-checked{
  250. height: 22px;width: 22px;
  251. border-radius: 11px;
  252. border: 2px solid #999;
  253. }
  254. .h-btn-value-use{
  255. background: #FFE05C;
  256. color: #333333;
  257. height: 30px;
  258. width: 80px;
  259. text-align: center;
  260. line-height: 30px;
  261. border-radius: 15px;
  262. }
  263. .h-btn-value-receive{
  264. background: #FFE05C;
  265. color: #333;
  266. height: 30px;
  267. width: 80px;
  268. text-align: center;
  269. line-height: 30px;
  270. border-radius: 15px;
  271. font-size: 14px;
  272. }
  273. .h-btn-img{
  274. display: flex;
  275. align-items: center;
  276. image{
  277. height: 68px;
  278. width: 68px;
  279. }
  280. }
  281. }
  282. }
  283. }
  284. }
  285. /* 产品订单 */
  286. .product-order{
  287. margin-top: 12px;
  288. }
  289. /* 底部 */
  290. .footer{
  291. margin-top: 30px;
  292. height: 120px;
  293. font-size: 12px;
  294. text-align: center;
  295. color: #666;
  296. }
  297. </style>