depotAcquisition.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
  1. <template>
  2. <view class="wrap">
  3. <view class="header">
  4. <view class='locationwrap' @click='naviageToPage("/pages/grain_pulse/position/position")'>
  5. <image class='location' src="../../../static/img/liangmai/icon_ditu@2x.png" mode=""></image>
  6. {{position.name}}
  7. </view>
  8. <view
  9. @click='naviageToPage("/pages/user/depotAcquisition/grainDeliveryRecord")'
  10. class='Regular flex align-item-center distribution justify-center'>
  11. <image class='cangku' src="../../../static/img/liangmai/cangku.png" mode=""></image>
  12. </view>
  13. </view>
  14. <u-search class="search" placeholder="日照香炉生紫烟" v-model="keyword" :show-action="false" @change="searchChange"></u-search>
  15. <view class="content1">
  16. <view class="row row1">
  17. <view>鲅鱼圈1号库</view>
  18. <view class='follow'>已关注</view>
  19. </view>
  20. <view class="row2">
  21. <view class='locationwrap' @click='naviageToPage("/pages/grain_pulse/position/position")'>
  22. <image class='location' src="../../../static/img/liangmai/icon_ditu@2x.png" mode=""></image>
  23. {{position.name}}
  24. </view>
  25. </view>
  26. <view class="row3">
  27. <view class="row3-item" v-for="(item,index) in listData" :key='index'>
  28. <u-read-more color='#22C572' show-height="140" :index="index" :shadow-style="shadowStyle" :toggle="true" close-text="展开阅读更多内容" @open='open' @close='close'>
  29. <rich-text :nodes="item.content" class="rich-item"></rich-text>
  30. <!-- @load="parseLoaded" -->
  31. <!-- <u-parse :html="item.content" ></u-parse> -->
  32. </u-read-more>
  33. </view>
  34. </view>
  35. <view class="row4">
  36. <u-button @click='naviageToPage("/pages/user/depotAcquisition/grainDeliveryRegistration")'>我要送粮</u-button>
  37. <view>2021-11-23</view>
  38. </view>
  39. </view>
  40. <u-modal v-model="isShowAlert" :title-style="{fontSize: '18px',fontWeight:'500'}"
  41. :content-style="{fontSize: '14px',fontWeight:'400'}" confirm-color='#22C572' confirm-text='确定' title='登录提示'
  42. showCancelButton='false' :content="content" @confirm="alertBtn" @cancel="cancelClick"></u-modal>
  43. </view>
  44. </template>
  45. <script>
  46. import {
  47. mapState
  48. } from 'vuex';
  49. export default {
  50. components: {
  51. },
  52. data() {
  53. return {
  54. isShowAlert: false,
  55. content: '当前登入信息验证失败,是否重新登录?',
  56. position: {
  57. name: '全国'
  58. },
  59. keyword: '遥看瀑布挂前川',
  60. shadowStyle: {
  61. backgroundImage: "none",
  62. paddingTop: "0",
  63. marginTop: "20rpx",
  64. },
  65. listData:[
  66. {
  67. content:'1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111我按水分地方地方萨芬撒初学者从行政村自行车在X初学者从行政村'
  68. },{
  69. content:'222222'
  70. },
  71. {
  72. content:'33333'
  73. }
  74. ]
  75. }
  76. },
  77. onLoad() {
  78. },
  79. // #ifndef MP
  80. onNavigationBarButtonTap(e) {
  81. const index = e.index;
  82. if (index === 0) {
  83. this.navTo('/pages/set/set');
  84. } else if (index === 1) {
  85. // #ifdef APP-PLUS
  86. const pages = getCurrentPages();
  87. const page = pages[pages.length - 1];
  88. const currentWebview = page.$getAppWebview();
  89. currentWebview.hideTitleNViewButtonRedDot({
  90. index
  91. });
  92. // #endif
  93. uni.navigateTo({
  94. url: '/pages/notice/notice'
  95. })
  96. }
  97. },
  98. // #endif
  99. computed: {
  100. ...mapState(['hasLogin', 'userInfo']),
  101. },
  102. onShow() {
  103. this.$api.doRequest('get', '/commonUser/api/checkSession').then(res => {
  104. console.log("checkSession", res)
  105. if (res.data.data == "INVALID") {
  106. this.isShowAlert = true;
  107. // uni.showModal({
  108. // title: '登录提示',
  109. // content: '当前登入信息验证失败,是否重新登录?',
  110. // showCancel: true,
  111. // confirmText: '登录',
  112. // success: (e) => {
  113. // if (e.confirm) {
  114. // uni.navigateTo({
  115. // url: '/pages/public/login'
  116. // })
  117. // }
  118. // },
  119. // fail: () => {},
  120. // complete: () => {}
  121. // })
  122. }
  123. })
  124. console.log("hasLogin", this.hasLogin)
  125. },
  126. methods: {
  127. open(e){
  128. console.log(e)
  129. },
  130. close(e){
  131. console.log(e)
  132. },
  133. /**
  134. * 统一跳转接口,拦截未登录路由
  135. * navigator标签现在默认没有转场动画,所以用view
  136. */
  137. naviageToPage(url) {
  138. if (!this.hasLogin) {
  139. url = '/pages/public/login';
  140. }
  141. uni.navigateTo({
  142. url
  143. })
  144. },
  145. alertBtn() {
  146. uni.navigateTo({
  147. url: '/pages/public/login'
  148. })
  149. },
  150. cancelClick() {
  151. this.isShowAlert = false
  152. },
  153. searchChange(e){
  154. console.log(e)
  155. }
  156. }
  157. }
  158. </script>
  159. <style lang='scss' scoped>
  160. page {
  161. background: #F5F6FA;
  162. }
  163. .wrap {
  164. background: #fff;
  165. margin: 10px;
  166. border-radius: 10px;
  167. padding: 10px;
  168. }
  169. .header {
  170. padding: 0 25rpx;
  171. background: #fff;
  172. border-radius: 0 0 10px 10px;
  173. display: flex;
  174. justify-content: space-between;
  175. align-items: center;
  176. }
  177. .location {
  178. width: 32rpx;
  179. height: 32rpx;
  180. margin-right: 10rpx;
  181. }
  182. .locationwrap {
  183. font-size: 16px;
  184. display: flex;
  185. align-items: center;
  186. }
  187. .cangku {
  188. width: 16.5px;
  189. height: 16.5px;
  190. margin-right: 5px;
  191. }
  192. .search{
  193. margin-top: 20rpx!important;
  194. }
  195. .rich-item{
  196. line-height: 44rpx;
  197. }
  198. .row1{
  199. display: flex;
  200. justify-content: space-between;
  201. }
  202. .row4{
  203. display: flex;
  204. }
  205. </style>