123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277 |
- <template>
- <view class="center">
- <view class="introduce-section">
- <view class="informations " v-for="(item , index) in procurementPlanInfos" :Key="index">
- <view @click="details(item)">
- <view class="flex">
- <view class="logo flex">
- 买粮
- </view>
- <text class="grain">{{item.goodsName}}</text>
- <view class="status">
- <view v-if='item.status=="已驳回"' class='put2'>未通过</view>
- <view v-if='item.status=="待审核"' class='put1'>审核中</view>
- <view v-if='item.status=="已认证"' class='put'>已通过</view>
- </view>
- </view>
- <view class="address">{{item.receivePrivate}}{{item.receiveCity}}{{item.receiveArea}}</view>
- <view class="flex ">
- <view class="weight" >{{item.weight > 0 ? item.weight : 0}}吨</view>
- <text class="unitPrice">{{item.unitPrice}} <text class="amount">元/吨</text></text>
-
- </view>
- </view>
- <hr style="margin: 16px 0; color: #EEEEEE;">
- <view class="flex" style="right: 10px;">
- <view @click='edit(item)' v-if='item.status!="待审核"' class='anniu'>编辑</view>
- <view class='anniu' @click="switch1(item)" v-if="item.showFlag == 0">隐藏</view>
- <view class='anniu' @click="switch1(item)" v-if="item.showFlag == 1">显示</view>
- <view class='anniu' @click="deleteRelease(item)">删除</view>
- </view>
-
- <!-- <view v-if='item.status=="已驳回"' class='cu-tag radius line-pink put'>未通过</view>
- <view v-if='item.status=="待审核"' class='cu-tag radius line-pink put'>审核中</view>
- <view v-if='item.status=="已认证"' class='cu-tag radius line-pink put'>已通过</view> -->
- </view>
- </view>
- <!-- <view class="page-bottom">
- <view class="action-btn-group">
- <picker style='display:inline-block;' @change="releaseChange" :value="releases" :range="releaseType">
- <button type="primary" class=" action-btn no-border add-cart-btn" >发布</button>
- <view class="picker">
- {{releases>-1?releaseType[releases]:''}}
- </view>
- </picker>
- </view>
- </view> -->
- <picker style='display:inline-block;width: 100%;' @change="releaseChange" :value="releases" :range="releaseType">
- <button type="primary" class="btn" >发布</button>
- <view class="picker">
- {{releases>-1?releaseType[releases]:''}}
- </view>
- </picker>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- releaseType:["我要卖粮","我要买粮"],
- release:'',
- releases:'',
- receivePrivate:'',
- procurementPlanInfo:{
- pageSize:10,
- currentPage:1
- },
- releaseIndex:"",
- pageSize:10,
- currentPage:1,
- procurementPlanInfos:[],
- }
- },
- onLoad(){
- this.getList()
- },
- methods: {
- switch1(item){
- // if (!this.hasLogin) {
- uni.showModal({
- // title: '登录提示',
- content: '隐藏后该信息不再展示给其他用户,是否确定隐藏?',
- showCancel: true,
- confirmText: '确定',
- success: (e) => {
- this.$api.doRequest('post','/procurementPlanInfo/api/editStatus',{id:item.id,flag:0}).then(res => {
- // this.procurementPlanInfos = res.data.data.records
- console.log(res)
- if (res.data.message == "Success") {
- this.$api.msg('隐藏成功!')
- this.getList()
- return
- }
-
- })
- .catch(res => {
- uni.showToast({
- title: res.errmsg,
- icon:'none',
- duration: 2000
- })
- });
- },
- fail: () => {},
- complete: () => {}
- })
- // }
- },
- edit(item){
- uni.navigateTo({
- url: `/pageD/myRelease/buyEdit?id=${item.id}`
- })
- },
- deleteRelease(item){
- // if (!this.hasLogin) {
- uni.showModal({
- // title: '登录提示',
- content: '确定删除该信息?',
- showCancel: true,
- confirmText: '确定',
- success: (e) => {
- this.$api.doRequest('post','/procurementPlanInfo/api/deleteProcurementPlan',{id:item.id}).then(res => {
- if (res.data.message == "Success") {
- this.$api.msg('删除成功!')
- this.getList()
- return
- }
-
- })
- .catch(res => {
- uni.showToast({
- title: res.errmsg,
- icon:'none',
- duration: 2000
- })
- });
- },
- fail: () => {},
- complete: () => {}
- })
- // }
- },
- releaseChange(e){
- this.receivePrivate = e.detail.value
- this.release = this.releaseType[this.receivePrivate];
- this.pageSize = 1
- if(this.release == "我要卖粮"){
- uni.navigateTo({
- url: `/pageD/myRelease/sellGrain`
- })
- }else if(this.release == "我要买粮"){
- uni.navigateTo({
- url: `/pageD/myRelease/buyGrain`
- })
- }
- },
- details(item){
- uni.navigateTo({
- url: `/pageD/myRelease/buyDetails?id=${item.id}`
- })
- },
- getList(){
- // this.procurementPlanInfo.pcFlag = "1"
- this.$api.doRequest('get','/procurementPlanInfo/selectProcurementPlanInfo',this.procurementPlanInfo).then(res => {
- this.procurementPlanInfos = res.data.data.records
- })
- .catch(res => {
- uni.showToast({
- title: res.errmsg,
- icon:'none',
- duration: 2000
- })
- });
- }
- }
- }
- </script>
- <style>
- .center {
- padding: 10px 20px;
- background-color: #F5F6FA;
- }
- .informations {
- background-color: #FFFFFF;
- margin-top: 20px;
- border-radius: 16px;
- padding: 10px;
- }
- .labels {
- display: inline-flex;
- line-height: 20px;
- margin-right: 40px;
- }
- .fabuBut{
- margin-bottom: 0px;
- }
- .logo{
- width: 36px;
- height: 24px;
- background-color: #FEECE6;
- color: #FE6430;
- border-radius: 8px;
- padding: 3px;
- margin-top: 2px;
- }
- .grain{
- font-size: 18px;
- color: #333333;
- font-weight: 600;
- margin-left: 20px;
- }
- .address{
- margin-left: 56px;
- font-size: 14px;
- color: #333333;
- }
- .weight{
- margin-left: 56px;
- font-size: 14px;
- color: #878C9C;
- }
- .unitPrice{
-
- font-size: 22px;
- font-weight: 600;
- /* margin-left: 200px; */
- position: absolute;
- /* text-align: right; */
- right: 40px;
- }
- /* .amount{
- width: 100%;
- } */
- .amount{
- margin-left: 10px;
- font-size: 12px;
-
- }
- .status{
- position: absolute;
- right: 40px;
- }
- .put{
- color: #22C572;
- font-size: 14px;
- }
- .put1{
- color: #FE6430;
- font-size: 14px;
- }
- .put2{
- color: #FB1E1E;
- font-size: 14px;
- }
- .anniu{
- width: 60px;
- height: 30px;
- border: 1px solid #CDCDCD;
- border-radius: 16px;
- text-align: center;
- line-height: 30px;
- margin-left: 10px;
- }
- .btn{
- width: 100%;
- border-radius: 20px;
- background-color: #22C572;
- margin-top: 10px;
- }
- </style>
|