Index.vue 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245
  1. <template>
  2. <div class="shopIndex-wrap">
  3. <div class="mess-wrap">
  4. <div class="mess-title">
  5. <h5>您好!{{$store.state.userMess.userName}}店铺</h5>
  6. <el-button @click="toShowEditShop">修改店铺信息</el-button>
  7. </div>
  8. <div>
  9. <img src="../../assets/images/admin/userImg.png" />
  10. <div class="mess-content">
  11. <p>店铺名称:{{$store.state.userMess.userName}}</p>
  12. <p>登陆账号:{{$store.state.userMess.loginId}}</p>
  13. <p>登陆密码:{{$store.state.userMess.password}}</p>
  14. <p>店铺标签:{{$store.state.userMess.label}}</p>
  15. </div>
  16. </div>
  17. </div>
  18. <el-dialog :title="dialogTitle" :visible.sync="dialogTableVisible" :show-close="false">
  19. <div class="dialogheader">
  20. <el-form label-position="right" label-width="80px">
  21. <el-form-item label="店铺名称">
  22. <el-input v-model="showItem.userName"></el-input>
  23. </el-form-item>
  24. <el-form-item label="登陆账号">
  25. <el-input v-model="showItem.name"></el-input>
  26. </el-form-item>
  27. <el-form-item label="登陆密码">
  28. <el-input v-model="showItem.password"></el-input>
  29. </el-form-item>
  30. <el-form-item label="店铺标签">
  31. <el-select v-model="showItem.label" placeholder="请选择">
  32. <el-option
  33. v-for="item in shopTagList"
  34. :key="item.id"
  35. :label="item.text"
  36. :value="item.value">
  37. </el-option>
  38. </el-select>
  39. </el-form-item>
  40. <el-form-item>
  41. <el-button type="primary" @click="toEditShop">确认修改</el-button>
  42. <el-button @click="toCancel">取消</el-button>
  43. </el-form-item>
  44. </el-form>
  45. </div>
  46. </el-dialog>
  47. </div>
  48. </template>
  49. <script>
  50. export default{
  51. data(){
  52. return{
  53. shopTagList:[],
  54. dialogTableVisible:false,
  55. dialogTitle:"",
  56. showItem:{
  57. id:"",
  58. userName:"",
  59. name:"",
  60. password:"",
  61. label:"",
  62. address:"",
  63. }
  64. }
  65. },
  66. mounted(){
  67. this.getShopTagList();
  68. },
  69. methods:{
  70. getShopTagList(){
  71. this.axios.post(this.Api.getTagtList,{}).then((res)=>{
  72. this.shopTagList=res.data;
  73. }).catch((err)=>{
  74. console.log("getShopTagList:"+err);
  75. });
  76. },
  77. toCancel(){
  78. this.dialogTableVisible=false;
  79. this.dialogTitle="";
  80. this.showItem={
  81. id:"",
  82. userName:"",
  83. name:"",
  84. password:"",
  85. label:""
  86. }
  87. },
  88. toShowEditShop(){
  89. this.dialogTableVisible=true;
  90. this.dialogTitle="修改信息";
  91. this.showItem.id=this.$store.state.userMess.id;
  92. this.showItem.userName=this.$store.state.userMess.userName;
  93. this.showItem.name=this.$store.state.userMess.loginId;
  94. this.showItem.password=this.$store.state.userMess.password;
  95. this.showItem.label=this.$store.state.userMess.label;
  96. },
  97. toEditShop(){
  98. if(this.showItem.name==""||this.showItem.password==""||this.showItem.userName==""||this.showItem.label==""){
  99. this.$message.error('请填写完整信息');
  100. console.log(this.showItem)
  101. return;
  102. }
  103. let param={
  104. type:1,
  105. handle:"2",
  106. mess:this.showItem
  107. }
  108. this.axios.post(this.Api.adminHandle,param).then((res)=>{
  109. console.log(res);
  110. if(res.data.code==200){
  111. this.$message({
  112. message: '编辑成功',
  113. type: 'success'
  114. });
  115. this.toCancel();
  116. this.$store.commit('login',{userMess:res.data.afterEdit.mess});
  117. }
  118. }).catch((err)=>{
  119. console.log("toEditShop:"+err);
  120. });
  121. }
  122. }
  123. }
  124. </script>
  125. <style scoped>
  126. .shopIndex-wrap{
  127. width: 100%;
  128. padding: 0 20px;
  129. }
  130. .mess-title{
  131. width: 100%;
  132. padding: 0 20px;
  133. text-align: left;
  134. }
  135. .mess-title h5{
  136. font-size: 18px;
  137. line-height: 35px;
  138. display: inline-block;
  139. }
  140. .mess-title button{
  141. float: right;
  142. }
  143. .mess-title .el-button{
  144. padding: 8px 16px;
  145. margin-top: 5px;
  146. }
  147. .shopIndex-wrap .mess-wrap{
  148. width: 100%;
  149. height: 185px;
  150. margin-top: 20px;
  151. background-color: #fff;
  152. border-left: 6px solid #3eb983;
  153. }
  154. .shopIndex-wrap .mess-wrap img{
  155. width: 110px;
  156. height: 110px;
  157. display: block;
  158. float: left;
  159. margin: 15px 20px 15px;
  160. }
  161. .shopIndex-wrap .mess-content{
  162. width: calc(100% - 150px);
  163. height: 100%;
  164. float: left;
  165. margin-top: 5px;
  166. }
  167. .shopIndex-wrap .mess-content p{
  168. text-align: left;
  169. font-size: 16px;
  170. line-height: 35px;
  171. }
  172. </style>
  173. <style>
  174. .shopIndex-wrap .el-dialog{
  175. width: 500px;
  176. /*height: 280px;*/
  177. border-radius: 6px;
  178. text-align: left;
  179. }
  180. .shopIndex-wrap .el-dialog__header{
  181. padding: 20px 30px 0 40px;
  182. }
  183. .shopIndex-wrap .el-dialog__body{
  184. padding: 20px 30px;
  185. }
  186. .shopIndex-wrap .dialogheader{
  187. width: 100%;
  188. /*height: 60px;*/
  189. }
  190. .shopIndex-wrap .dialogheader p{
  191. width: 360px;
  192. height: 30px;
  193. line-height: 30px;
  194. margin-top: 10px;
  195. border:1px solid #3eb983;
  196. border-radius: 6px;
  197. text-align: left;
  198. padding-left: 10px;
  199. margin-left: 60px;
  200. }
  201. .shopIndex-wrap .dialogheader p input{
  202. height: 24px;
  203. line-height: 24px;
  204. border:0;
  205. margin-left: 20px;
  206. }
  207. .shopIndex-wrap .dialogheader .button{
  208. background: #3eb983;
  209. color: #fff;
  210. text-align: center;
  211. margin-top: 40px;
  212. cursor: pointer;
  213. }
  214. .shopIndex-wrap .dialogheader .el-button{
  215. width: 173px;
  216. padding: 10px 0;
  217. }
  218. .shopIndex-wrap .dialogheader .el-form-item{
  219. margin-bottom: 15px;
  220. }
  221. .shopIndex-wrap .dialogheader .el-button+.el-button{
  222. margin-left: 0;
  223. }
  224. .shopIndex-wrap .dialogheader .el-button--primary{
  225. background-color: #3eb983;
  226. border-color: #3eb983;
  227. }
  228. .shopIndex-wrap .dialogheader .el-button--primary:hover{
  229. background-color: #3eb983;
  230. border-color: #3eb983;
  231. }
  232. .shopIndex-wrap .dialogheader .el-button--default{
  233. background-color: #bfcbd9;
  234. color: #fff;
  235. }
  236. .shopIndex-wrap .dialogheader .el-button--default:hover{
  237. background-color: #bfcbd9;
  238. border-color: #bfcbd9;
  239. color: #fff;
  240. }
  241. </style>