shareCountList.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226
  1. <template>
  2. <view class="box">
  3. <template v-if="shareList.length > 0">
  4. <view class="meauList" v-for="item in shareList" :key="item.devId">
  5. <view class="menu-item">
  6. <view class="meanLeft">
  7. <text>设备名称</text>
  8. </view>
  9. <view class="meanRight">
  10. <text>{{ item.devName }}</text></view
  11. >
  12. </view>
  13. <view class="menu-item">
  14. <view class="meanLeft">
  15. <text>设备序列号</text>
  16. </view>
  17. <view class="meanRight">
  18. <text>{{ devInfo.clientId }}</text></view
  19. >
  20. </view>
  21. <view class="menu-item">
  22. <view class="meanLeft">
  23. <text>分享人手机号</text>
  24. </view>
  25. <view class="meanRight">
  26. <text>{{ item.sharerPhone }}</text></view
  27. >
  28. </view>
  29. <view class="menu-item">
  30. <view class="meanLeft">
  31. <text>被分享人手机号</text>
  32. </view>
  33. <view class="meanRight">
  34. <text>{{ item.sharedPhone }}</text></view
  35. >
  36. </view>
  37. <view class="menu-item">
  38. <view class="meanLeft">
  39. <text>分享时间</text>
  40. </view>
  41. <view class="meanRight">
  42. <text>{{ item.shareTime }}</text></view
  43. >
  44. </view>
  45. <view class="menu-item">
  46. <view class="meanLeft">
  47. <text>分享状态</text>
  48. </view>
  49. <view class="meanRight">
  50. <text v-show="item.state == 0"> 待确认 </text>
  51. <text v-show="item.state == 1"> 已确认 </text>
  52. <text v-show="item.state == 2"> 已拒绝 </text>
  53. </view>
  54. </view>
  55. <view class="menu-item" @click="goShareDetail(item)">
  56. <view class="meanLeft">
  57. <text>查看详情</text>
  58. </view>
  59. <view class="meanRight">
  60. <image
  61. src="../../static/rightArrow.png"
  62. style="width: 30rpx; height: 30rpx"
  63. ></image>
  64. </view>
  65. </view>
  66. </view>
  67. </template>
  68. <template v-else>
  69. <view class="noShare">暂无分享记录</view>
  70. </template>
  71. </view>
  72. </template>
  73. <script>
  74. export default {
  75. data() {
  76. return {
  77. status: null,
  78. devInfo: "",
  79. shareList: [],
  80. };
  81. },
  82. methods: {
  83. getShareList() {
  84. this.$http
  85. .get(
  86. "wap/share/queryByDevId",
  87. {
  88. userId: uni.getStorageSync("userId"),
  89. devId: this.devInfo.devId,
  90. },
  91. {
  92. header: {
  93. "Content-Type": "application/json;charset=UTF-8",
  94. token: uni.getStorageSync("tokenValue") || "",
  95. },
  96. }
  97. )
  98. .then((res) => {
  99. console.log(res, 9999);
  100. if (res.data.data) {
  101. this.shareList = res.data.data;
  102. }
  103. });
  104. },
  105. goShareDetail(item) {
  106. uni.navigateTo({
  107. url:
  108. "/pagesA/shareDetail/shareDetail?shareDetail=" +
  109. JSON.stringify(item),
  110. });
  111. },
  112. searchShareList() {
  113. this.shareList = [];
  114. this.getShareList();
  115. },
  116. },
  117. onShow() {
  118. this.searchShareList();
  119. },
  120. onLoad(options) {
  121. this.devInfo = JSON.parse(options.devInfo);
  122. },
  123. onPullDownRefresh() {
  124. uni.showNavigationBarLoading();
  125. this.searchShareList();
  126. setTimeout(() => {
  127. uni.hideLoading();
  128. uni.hideNavigationBarLoading();
  129. uni.stopPullDownRefresh();
  130. }, 2000);
  131. },
  132. };
  133. </script>
  134. <style lang="less" scoped>
  135. // Main Styles
  136. .box {
  137. padding: 10rpx 18rpx;
  138. width: 100vw;
  139. height: 100vh;
  140. background: linear-gradient(180deg, #faede2 0%, #f4f4f4 100%);
  141. box-sizing: border-box;
  142. .meauList {
  143. width: 710rpx;
  144. margin: 18rpx auto;
  145. background: #fff;
  146. border-radius: 16rpx;
  147. box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.08);
  148. overflow: hidden;
  149. transition: all 0.3s ease;
  150. .menu-item {
  151. display: flex;
  152. align-items: center;
  153. justify-content: space-between;
  154. margin: 0 32rpx;
  155. padding: 32rpx 0;
  156. border-bottom: 1rpx solid #f0f0f0;
  157. &:last-of-type {
  158. border-bottom: none;
  159. }
  160. .meanLeft {
  161. flex: 1;
  162. color: #666;
  163. font-size: 28rpx;
  164. font-weight: 400;
  165. }
  166. .meanRight {
  167. flex: 1;
  168. text-align: right;
  169. color: #333;
  170. font-size: 28rpx;
  171. font-weight: 500;
  172. padding-left: 20rpx;
  173. }
  174. }
  175. .menu-bottom {
  176. display: flex;
  177. padding: 24rpx 32rpx;
  178. border-top: 1rpx solid #f0f0f0;
  179. .meanLeft,
  180. .meanRight {
  181. flex: 1;
  182. height: 80rpx;
  183. display: flex;
  184. align-items: center;
  185. justify-content: center;
  186. border-radius: 8rpx;
  187. font-size: 30rpx;
  188. font-weight: 500;
  189. transition: all 0.2s;
  190. &:active {
  191. opacity: 0.8;
  192. }
  193. }
  194. .meanLeft {
  195. background: #7b5245;
  196. color: white;
  197. margin-right: 16rpx;
  198. }
  199. .meanRight {
  200. background: fade(#ff4d4f, 10%);
  201. color: #ff4d4f;
  202. border: 1rpx solid fade(#ff4d4f, 30%);
  203. }
  204. }
  205. }
  206. .noShare {
  207. margin: 20rpx 20rpx;
  208. color: #999;
  209. font-size: 28rpx;
  210. text-align: center;
  211. }
  212. }
  213. </style>