list.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285
  1. <template>
  2. <view class="content">
  3. <view class="actives">
  4. <view
  5. class="notice-content-box"
  6. v-for="(item, index) in heatList"
  7. :key="index"
  8. style="justify-content: start; padding: 30rpx 0 30rpx 30rpx;border-radius: 0;"
  9. @click="goPayDeatil(item.code)" >
  10. <image
  11. src="/static/order-poster.svg"
  12. style="
  13. width: 112rpx;
  14. height: 112rpx;
  15. margin-right: 20rpx;
  16. border-radius: 10%;
  17. "
  18. ></image>
  19. <view class="notice-content" style="width: 75%">
  20. <view class="notice-content-font">{{
  21. item.name
  22. }}</view>
  23. <view class="display-flex-start" style="margin-top: 20rpx">
  24. <view class="notice-content-time color-a7adba">
  25. {{item.estate_name + item.building_name + item.unit + item.room}}
  26. </view>
  27. <view class="notice-content-time display-flex-start">
  28. <text class="color-a7adba">¥:</text>
  29. <text class="order-money">{{item.total_fee}}</text>
  30. </view>
  31. </view>
  32. <view class="display-between" style="margin-top: 20rpx">
  33. <view class="notice-content-time color-a7adba" style="visibility: hidden;">
  34. {{item.time}}
  35. </view>
  36. <view class="display-flex-start">
  37. <view class="notice-content-time" :style="{color:statusColor[item.status]}">{{statusObj[item.status]}}</view>
  38. </view>
  39. </view>
  40. </view>
  41. </view>
  42. <image src="../../static/nodata.svg" mode="aspectFit" style="width: 100%;" v-if="activityList.length === 0"></image>
  43. <view class="noLogin-box" v-if="owner_id == 0">
  44. <view>{{!isAuth ? '未登录': '未关联'}}</view>
  45. <view>{{!isAuth ? '请先完成授权登录': '请先完成关联住房'}}</view>
  46. <view class="withHouseBtn" @click="goHouse" v-show="isAuth">关联住房</view>
  47. <button type='primary' class="withHouseBtn" v-show="!isAuth" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">授权登录</button>
  48. </view>
  49. </view>
  50. </view>
  51. </template>
  52. <script>
  53. import md5 from "@/common/md5.js";
  54. export default {
  55. data() {
  56. return {
  57. message: "缴费订单",
  58. themeColor: "#007AFF",
  59. heatList: [],
  60. statusObj:getApp().globalData.statusObj,
  61. statusColor:getApp().globalData.statusColor,
  62. isAuth: true,
  63. owner_id : 0,
  64. };
  65. },
  66. onShow() {
  67. this.getHeatList();
  68. this.isAuth = getApp().globalData.isAuth;
  69. },
  70. onLoad() {
  71. this.getHeatList();
  72. this.isAuth = getApp().globalData.isAuth;
  73. },
  74. methods: {
  75. goPayDeatil(id) {
  76. uni.navigateTo({
  77. url: "/pages/heatingPage/pay?id=" + id,
  78. });
  79. },
  80. getPhoneNumber(e){
  81. let res = getApp().getPhoneNumber(e);
  82. if (res){
  83. this.goHouse();
  84. }
  85. },
  86. goHouse(){
  87. uni.navigateTo({
  88. url: "/pages/selfCenter/with_house",
  89. });
  90. },
  91. getHeatList() {
  92. let url = getApp().makeApiUrl("user",'user','get_order_list');
  93. let postData = {
  94. // page: 1,
  95. // page_size: 2,
  96. openId:getApp().globalData.open_id
  97. };
  98. uni.request({
  99. url: url,
  100. method: "POST",
  101. header: {
  102. "content-type": "application/x-www-form-urlencoded",
  103. },
  104. data: postData,
  105. success: (res) => {
  106. console.log(res);
  107. if (res.data.code === 200) {
  108. this.heatList = res.data.data.list;
  109. this.owner_id = res.data.data.owner_id;
  110. }
  111. },
  112. fail: () => {
  113. console.log("连接失败");
  114. },
  115. });
  116. },
  117. goHouse(){
  118. uni.navigateTo({
  119. url: "/pages/selfCenter/with_house",
  120. });
  121. },
  122. goAuth() {
  123. uni.navigateTo({
  124. url: "/pages/auth/index",
  125. });
  126. },
  127. },
  128. };
  129. </script>
  130. <style lang="scss" scoped>
  131. .content {
  132. display: flex;
  133. flex-direction: column;
  134. align-items: center;
  135. width: 100%;
  136. .choose-box {
  137. padding: 20rpx 0;
  138. width: 100%;
  139. display: flex;
  140. // position: fixed;
  141. height: 50rpx;
  142. top: 0;
  143. // margin-bottom: 50rpx;
  144. .type,
  145. .state {
  146. width: 50%;
  147. display: flex;
  148. justify-content: center;
  149. position: relative;
  150. .packer {
  151. width: 100%;
  152. .picker_title {
  153. z-index: 99;
  154. width: 100%;
  155. height: 100%;
  156. display: flex;
  157. justify-content: center;
  158. }
  159. }
  160. }
  161. .type::after,
  162. .state::after {
  163. z-index: -1;
  164. content: "";
  165. position: absolute;
  166. right: 30%;
  167. top: 20%;
  168. width: 0;
  169. height: 0;
  170. border-top: 15rpx solid rgb(173, 173, 173);
  171. border-left: 15rpx solid transparent;
  172. border-right: 15rpx solid transparent;
  173. }
  174. }
  175. .actives {
  176. width: 90%;
  177. // margin-top: 50rpx;
  178. display: flex;
  179. flex-direction: column;
  180. align-items: center;
  181. .actives-item {
  182. width: 100%;
  183. // height: 150rpx;
  184. box-shadow: 0px 4rpx 32rpx rgba(0, 0, 0, 0.1);
  185. border-radius: 32rpx;
  186. // margin-top: 20px;
  187. padding: 20rpx;
  188. display: flex;
  189. flex-direction: column;
  190. margin-top: 20rpx;
  191. margin-bottom: 10rpx;
  192. .readShare {
  193. display: flex;
  194. justify-content: flex-end;
  195. font-size: 26rpx;
  196. color: rgba(0, 0, 0, 0.3);
  197. margin-top: 20rpx;
  198. align-items: center;
  199. .active-tips-box {
  200. font-size: 28rpx;
  201. padding: 10rpx;
  202. border-radius: 10rpx;
  203. color: #fff;
  204. margin-right: 50rpx;
  205. }
  206. .wait-color {
  207. background-color: #aee359;
  208. }
  209. .ing-color {
  210. background-color: #00a8ea;
  211. }
  212. .end-color {
  213. background-color: #d7d7d7;
  214. }
  215. .read {
  216. width: 20%;
  217. text-align: center;
  218. // margin-right: 60rpx;
  219. }
  220. .share {
  221. width: 20%;
  222. text-align: center;
  223. }
  224. }
  225. }
  226. }
  227. }
  228. .active {
  229. color: $uni-color-primary;
  230. }
  231. .color {
  232. background-color: #589cff !important;
  233. }
  234. .notice-content-box {
  235. display: flex;
  236. padding: 30rpx 20rpx 30rpx 20rpx;
  237. background-color: #ffffff;
  238. box-shadow: 0px 4rpx 32rpx rgba(0, 0, 0, 0.1);
  239. border-radius: 32rpx;
  240. margin-top: 20rpx;
  241. justify-content: space-between;
  242. width: 96%;
  243. .notice-content-font {
  244. font-size: 32rpx;
  245. color: #0d1937;
  246. /* font-weight: 600; */
  247. overflow: hidden;
  248. text-overflow: ellipsis;
  249. white-space: nowrap;
  250. }
  251. .notice-content-time {
  252. font-size: 26rpx;
  253. letter-spacing: 0.02em;
  254. color: #333333;
  255. }
  256. .order-money {
  257. color: #d9001b;
  258. font-size: 36rpx;
  259. font-weight: 500;
  260. }
  261. }
  262. .noLogin-box {
  263. width: 100%;
  264. display: flex;
  265. flex-direction: column;
  266. justify-content: space-between;
  267. align-items: center;
  268. margin-top: 160rpx;
  269. color: #a7adba;
  270. }
  271. .withHouseBtn {
  272. color: #589cff;
  273. cursor: pointer;
  274. margin-top: 40rpx;
  275. }
  276. </style>