Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import router from '@ohos.router'
- import Fetch from '@system.fetch'
- import promptAction from '@ohos.promptAction'
- export default {
- data: {
- info:null,
- content_info:null
- },
- onInit() {
- let obj = router.getParams();
- if(obj !=null ) {
- this.info = obj;
- }
- },
- change_content(e) {
- this.content_info = e.text;
- },
- goToIndex() {
- router.replaceUrl({
- url: "pages/customerIndex/index",
- params:this.info
- })
- },
- submitComplaint(formData){
- formData.value["content"] = this.content_info;
- formData.value["customId"] = this.info.id;
- Fetch.fetch({
- url: this.$t("strings.url")+'complaint/add', //服务的地址
- data:formData.value, //可有可无,提交的数据
- method:"POST",
- header: {
- 'Content-Type': 'application/json'
- },
- success:(res) => {
- // TODO: res.data == true ? res.data === true 不行
- if(res.data == "true" ){
- promptAction.showToast({message:"提交成功!",duration:5000})
- }else {
- promptAction.showToast({message:"错误!",duration:5000})
- }
- },
- });
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement