release.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281
  1. <template>
  2. <view class="center">
  3. <view class="introduce-section">
  4. <view class="informations " v-for="(item , index) in procurementPlanInfos" :Key="index">
  5. <view @click="details(item)">
  6. <view class="flex">
  7. <view class="logo flex">
  8. 买粮
  9. </view>
  10. <text class="grain">{{item.goodsName}}</text>
  11. <view class="status">
  12. <view v-if='item.status=="已驳回"' class='put2'>未通过</view>
  13. <view v-if='item.status=="待审核"' class='put1'>审核中</view>
  14. <view v-if='item.status=="已认证"' class='put'>已通过</view>
  15. </view>
  16. </view>
  17. <view class="address">{{item.receivePrivate}}{{item.receiveCity}}{{item.receiveArea}}</view>
  18. <view class="flex ">
  19. <view class="weight" >{{item.weight > 0 ? item.weight : 0}}吨</view>
  20. <text class="unitPrice">{{item.unitPrice}} <text class="amount">元/吨</text></text>
  21. </view>
  22. </view>
  23. <hr style="margin: 16px 0; color: #EEEEEE;">
  24. <view class="flex" style="right: 10px;">
  25. <view @click='edit(item)' v-if='item.status!="待审核"' class='anniu'>编辑</view>
  26. <view class='anniu' @click="switch1(item)">隐藏</view>
  27. <view class='anniu' @click="switch1(item)">显示</view>
  28. <view class='anniu' @click="deleteRelease(item)">删除</view>
  29. </view>
  30. <!-- <view v-if='item.status=="已驳回"' class='cu-tag radius line-pink put'>未通过</view>
  31. <view v-if='item.status=="待审核"' class='cu-tag radius line-pink put'>审核中</view>
  32. <view v-if='item.status=="已认证"' class='cu-tag radius line-pink put'>已通过</view> -->
  33. </view>
  34. </view>
  35. <!-- <view class="page-bottom">
  36. <view class="action-btn-group">
  37. <picker style='display:inline-block;' @change="releaseChange" :value="releases" :range="releaseType">
  38. <button type="primary" class=" action-btn no-border add-cart-btn" >发布</button>
  39. <view class="picker">
  40. {{releases>-1?releaseType[releases]:''}}
  41. </view>
  42. </picker>
  43. </view>
  44. </view> -->
  45. <picker style='display:inline-block;width: 100%;' @change="releaseChange" :value="releases" :range="releaseType">
  46. <button type="primary" class="btn" >发布</button>
  47. <view class="picker">
  48. {{releases>-1?releaseType[releases]:''}}
  49. </view>
  50. </picker>
  51. </view>
  52. </template>
  53. <script>
  54. export default {
  55. data() {
  56. return {
  57. releaseType:["我要卖粮","我要买粮"],
  58. release:'',
  59. releases:'',
  60. receivePrivate:'',
  61. procurementPlanInfo:{
  62. pageSize:10,
  63. currentPage:1
  64. },
  65. releaseIndex:"",
  66. pageSize:10,
  67. currentPage:1,
  68. procurementPlanInfos:[],
  69. }
  70. },
  71. onLoad(){
  72. console.log("release.vue onload")
  73. this.getList()
  74. },
  75. methods: {
  76. switch1(item){
  77. console.log(125489)
  78. // if (!this.hasLogin) {
  79. uni.showModal({
  80. // title: '登录提示',
  81. content: '隐藏后该信息不再展示给其他用户,是否确定隐藏?',
  82. showCancel: true,
  83. confirmText: '确定',
  84. success: (e) => {
  85. this.$api.doRequest('post','/procurementPlanInfo/api/editStatus',{id:item.id,flag:0}).then(res => {
  86. this.procurementPlanInfos = res.data.data.records
  87. if (res.errmsg == "Success") {
  88. this.$api.msg('隐藏成功!')
  89. return
  90. }
  91. })
  92. .catch(res => {
  93. uni.showToast({
  94. title: res.errmsg,
  95. icon:'none',
  96. duration: 2000
  97. })
  98. });
  99. },
  100. fail: () => {},
  101. complete: () => {}
  102. })
  103. // }
  104. },
  105. edit(item){
  106. uni.navigateTo({
  107. url: `/pageD/myRelease/buyEdit?id=${item.id}`
  108. })
  109. },
  110. deleteRelease(item){
  111. // if (!this.hasLogin) {
  112. uni.showModal({
  113. // title: '登录提示',
  114. content: '确定删除该信息?',
  115. showCancel: true,
  116. confirmText: '确定',
  117. success: (e) => {
  118. this.$api.doRequest('post','/procurementPlanInfo/api/deleteProcurementPlan',{id:item.id}).then(res => {
  119. this.procurementPlanInfos = res.data.data.records
  120. if (res.errmsg == "Success") {
  121. this.$api.msg('删除成功!')
  122. this.getList()
  123. return
  124. }
  125. })
  126. .catch(res => {
  127. uni.showToast({
  128. title: res.errmsg,
  129. icon:'none',
  130. duration: 2000
  131. })
  132. });
  133. },
  134. fail: () => {},
  135. complete: () => {}
  136. })
  137. // }
  138. },
  139. releaseChange(e){
  140. this.receivePrivate = e.detail.value
  141. this.release = this.releaseType[this.receivePrivate];
  142. this.pageSize = 1
  143. if(this.release == "我要卖粮"){
  144. uni.navigateTo({
  145. url: `/pageD/myRelease/sellGrain`
  146. })
  147. }else if(this.release == "我要买粮"){
  148. uni.navigateTo({
  149. url: `/pageD/myRelease/buyGrain`
  150. })
  151. }
  152. },
  153. details(item){
  154. uni.navigateTo({
  155. url: `/pageD/myRelease/buyDetails?id=${item.id}`
  156. })
  157. },
  158. getList(){
  159. // this.procurementPlanInfo.pcFlag = "1"
  160. this.$api.doRequest('get','/procurementPlanInfo/selectProcurementPlanInfo',this.procurementPlanInfo).then(res => {
  161. this.procurementPlanInfos = res.data.data.records
  162. console.log(this.procurementPlanInfos,"对象")
  163. })
  164. .catch(res => {
  165. uni.showToast({
  166. title: res.errmsg,
  167. icon:'none',
  168. duration: 2000
  169. })
  170. });
  171. }
  172. }
  173. }
  174. </script>
  175. <style>
  176. .center {
  177. padding: 10px 20px;
  178. background-color: #F5F6FA;
  179. }
  180. .informations {
  181. background-color: #FFFFFF;
  182. margin-top: 20px;
  183. border-radius: 16px;
  184. padding: 10px;
  185. }
  186. .labels {
  187. display: inline-flex;
  188. line-height: 20px;
  189. margin-right: 40px;
  190. }
  191. .fabuBut{
  192. margin-bottom: 0px;
  193. }
  194. .logo{
  195. width: 36px;
  196. height: 24px;
  197. background-color: #FEECE6;
  198. color: #FE6430;
  199. border-radius: 8px;
  200. padding: 3px;
  201. margin-top: 2px;
  202. }
  203. .grain{
  204. font-size: 18px;
  205. color: #333333;
  206. font-weight: 600;
  207. margin-left: 20px;
  208. }
  209. .address{
  210. margin-left: 56px;
  211. font-size: 14px;
  212. color: #333333;
  213. }
  214. .weight{
  215. margin-left: 56px;
  216. font-size: 14px;
  217. color: #878C9C;
  218. }
  219. .unitPrice{
  220. font-size: 22px;
  221. font-weight: 600;
  222. /* margin-left: 200px; */
  223. position: absolute;
  224. /* text-align: right; */
  225. right: 40px;
  226. }
  227. /* .amount{
  228. width: 100%;
  229. } */
  230. .amount{
  231. margin-left: 10px;
  232. font-size: 12px;
  233. }
  234. .status{
  235. position: absolute;
  236. right: 40px;
  237. }
  238. .put{
  239. color: #22C572;
  240. font-size: 14px;
  241. }
  242. .put1{
  243. color: #FE6430;
  244. font-size: 14px;
  245. }
  246. .put2{
  247. color: #FB1E1E;
  248. font-size: 14px;
  249. }
  250. .anniu{
  251. width: 60px;
  252. height: 30px;
  253. border: 1px solid #CDCDCD;
  254. border-radius: 16px;
  255. text-align: center;
  256. line-height: 30px;
  257. margin-left: 10px;
  258. }
  259. .btn{
  260. width: 100%;
  261. border-radius: 20px;
  262. background-color: #22C572;
  263. margin-top: 10px;
  264. }
  265. </style>